예제 #1
0
파일: TestShould.cs 프로젝트: havocbcn/LIS
        public void BeCreatedEmpty()
        {
            var operationFactory = Substitute.For <IOperationFactory>();

            var test = new TestExample1(operationFactory);

            test.Should().NotBeNull();
            test.Result.Should().Be(Result.NotTested);
            operationFactory.Received(0).CreateOperation(Arg.Any <string>());
        }
예제 #2
0
        public void ObtainTestExample1()
        {
            var operationFactory = Substitute.For <IOperationFactory>();

            var factory = new TestFactory(operationFactory);

            var expectedTest = new TestExample1(operationFactory);
            var actualTest   = factory.CreateTest("testexample1");

            actualTest.Should().BeEquivalentTo(expectedTest);
        }
예제 #3
0
파일: TestShould.cs 프로젝트: havocbcn/LIS
        public void ExecuteOperations(string name)
        {
            var operationFactory = Substitute.For <IOperationFactory>();
            var operation        = new OperationExample1();

            operationFactory.CreateOperation(name).Returns(operation);

            var test            = new TestExample1(operationFactory);
            var operationActual = test.AddOperation(name);

            operationFactory.Received(1).CreateOperation(name);
            operationActual.Should().Be(operation);
        }
예제 #4
0
파일: OrderShould.cs 프로젝트: havocbcn/LIS
        public void AddATestByName(string testName)
        {
            var testFactory      = Substitute.For <ITestFactory>();
            var operationFactory = Substitute.For <IOperationFactory>();
            var test             = new TestExample1(operationFactory);

            testFactory.CreateTest(testName).Returns(test);

            var order = new Order(testFactory);

            var actualTest = order.AddTest(testName);

            actualTest.Should().Be(test);
            testFactory.Received(1).CreateTest(testName);
        }