Пример #1
0
        public void UnderlyingObjectShouldChangeState()
        {
            // Given
            var testClassWithState = new TestClassWithState();
            var proxyObject        = _sutForInterface.CreateProxy(testClassWithState);

            // When
            proxyObject.GetNextInt();
            proxyObject.GetNextInt();

            // Then
            Assert.Equal(2, testClassWithState.InternalState);
        }
Пример #2
0
        public void ShouldWrapCall()
        {
            // Given
            var testClassWithState = new TestClassWithState();
            var proxyObject        = _sutForInterface.CreateProxy(testClassWithState);

            // When
            var firstCallResult  = proxyObject.GetNextInt();
            var secondCallResult = proxyObject.GetNextInt();

            // Then
            Assert.Equal(0, firstCallResult);
            Assert.Equal(1, secondCallResult);
        }