Exemple #1
0
        public void ShouldBeAbleToDefineOrderOfMocks()
        {
            //Arrange
            IInOrderDependency orderedDependencyMock = Mock.Create <IInOrderDependency>();

            orderedDependencyMock.Arrange(x => x.First()).Returns(false).InOrder();
            orderedDependencyMock.Arrange(x => x.Second()).Returns("Hi").InOrder();
            orderedDependencyMock.Arrange(x => x.Third()).Returns(42).InOrder();
            var classUnderTest = new ClassUnderTest(orderedDependencyMock);

            //Act
            var result = classUnderTest.TestMe();

            //Assert
            Assert.IsTrue(result);
            Mock.Assert(orderedDependencyMock);
        }
Exemple #2
0
 public ClassUnderTest(IInOrderDependency sequentialDependency)
 {
     _sequentialDependency = sequentialDependency;
 }
 public ClassUnderTest(IInOrderDependency sequentialDependency)
 {
     _sequentialDependency = sequentialDependency;
 }