コード例 #1
0
        public void CurrentCalled_OnInnerEnumerator()
        {
            // Arrange
            var innerEnumerator = new Mock <IEnumerator <int> >();

            innerEnumerator.SetupGet(innerEnum => innerEnum.Current)
            .Verifiable();
            var delegatingEnumerator = new DelegatingEnumerator <int, int>(
                innerEnumerator.Object,
                wrapperProvider: null);

            // Act
            var obj = delegatingEnumerator.Current;

            // Assert
            innerEnumerator.Verify();
        }
コード例 #2
0
        public void ResetCalled_OnInnerEnumerator()
        {
            // Arrange
            var innerEnumerator = new Mock <IEnumerator <int> >();

            innerEnumerator.Setup(innerEnum => innerEnum.Reset())
            .Verifiable();
            var delegatingEnumerator = new DelegatingEnumerator <int, int>(
                innerEnumerator.Object,
                wrapperProvider: null);

            // Act
            delegatingEnumerator.Reset();

            // Assert
            innerEnumerator.Verify();
        }