public void OnSuccess_AfterCall_ReturnArgumentValue_ShouldReturnValueWhichBiggerInPlusOne() { int initNumber = 1; dynamic myTest = new MyTestClass(); int initNumber2 = myTest.ReturnArgumentValue(initNumber); Assert.AreEqual(initNumber + 1, initNumber2); }
public void OnSuccess_AfterCall_InitTestEntity_ShouldBeApplied_IncrementArgumentValueAspect() { var entity = new TestEntity(); dynamic myTest = new MyTestClass(); myTest.InitTestEntity(entity); Assert.AreEqual(entity.Name, "KingAOP_OnSuccess"); Assert.AreEqual(entity.Number, 100); }
public void IntByRefArgumentShouldBeUpdatedByAspect() { dynamic test = new MyTestClass(); int value = 5; test.MethodWithRefArgs(ref value); Assert.IsTrue(value == -1); }
public void OnSuccess_WhenSomeExceptionHappens_Then_OnSuccessShouldNotBeCalled() { int initNumber = 1, initNumber2 = 0; dynamic myTest = new MyTestClass(); try { initNumber2 = myTest.ReturnArgumentValueWithException(initNumber); } catch { } Assert.AreEqual(0, initNumber2); }