public void AdditionDifferentProps() { var obj = new TestClass(); Assert.AreEqual($"{{\"{nameof(obj.NumProp)}, {nameof(obj.NumProp2)}\":{obj.NumProp + obj.NumProp2}}}", Morpher.Describe(obj, o => o.NumProp + o.NumProp2 )); }
public void TwoProperties() { var obj = new TestClass(); Assert.AreEqual($"{{\"{nameof(obj.NumProp)}\":{obj.NumProp},\"{nameof(obj.NumProp2)}\":{obj.NumProp2}}}", Morpher.Describe(obj, o => o.NumProp, o => o.NumProp2 )); }
public void ObjectMethodWithDifferentObjectParam() { var obj = new TestClass(); var obj2 = new TestClass(); Assert.AreEqual($"{{\"{nameof(obj.MethodWithParam)}()\":\"{obj.MethodWithParam(obj2.NumProp.ToString())}\"}}", Morpher.Describe(obj, o => o.MethodWithParam(obj2.NumProp.ToString()) )); }
public void ObjectProperty() { var obj = new TestClass(); var obj2 = new SecondTestClass(); obj.ObjProp = obj2; Assert.AreEqual($"{{\"{nameof(obj.ObjProp)}\":{{\"{nameof(obj2.SecNumProp)}\":{obj2.SecNumProp}}}}}", Morpher.Describe(obj, o => Morpher.Morph(o.ObjProp, o2 => o2.SecNumProp ) )); }
public void MethodWithParam() { var obj = new TestClass(); Assert.AreEqual($"{{\"{nameof(obj.MethodWithParam)}()\":\"{obj.MethodWithParam("foo")}\"}}", Morpher.Describe(obj, o => o.MethodWithParam("foo") )); }
public void Method() { var obj = new TestClass(); Assert.AreEqual($"{{\"{nameof(obj.MyMethod)}()\":\"{obj.MyMethod()}\"}}", Morpher.Describe(obj, o => o.MyMethod() )); }