public void OnEntry_ShouldChange_StringArgument_PassedAsRef() { dynamic myTest = new MyTestClass(); string argument = "argument"; string ret = myTest.ResturnStringArgumentPassedAsRef(ref argument); Assert.AreNotEqual(ret, "argument"); }
public void OnEntry_ShouldNotChange_StringArgument() { dynamic myTest = new MyTestClass(); string argument = myTest.ResturnStringArgument("argument"); Assert.AreEqual(argument, "argument"); }
public void IntByRefArgumentShouldBeUpdatedByAspect() { dynamic test = new MyTestClass(); int value = 5; test.MethodWithRefArgs(ref value); Assert.IsTrue(value == -1); }
public void OnEntry_ShouldHaveAbilityToChange_ReferenceArgument() { var entity = new TestEntity {Name = "Name", Number = 0}; dynamic myTest = new MyTestClass(); myTest.ResturnObjectArgument(entity); Assert.AreEqual("ChangedName", entity.Name); Assert.AreEqual(999, entity.Number); }
public void OnEntry_ShouldHaveAbilityToChange_ReferenceArgument() { var entity = new TestEntity { Name = "Name", Number = 0 }; dynamic myTest = new MyTestClass(); myTest.ResturnObjectArgument(entity); Assert.AreEqual("ChangedName", entity.Name); Assert.AreEqual(999, entity.Number); }