예제 #1
0
        public void Accept_ShouldBeVisited()
        {
            // Arrange
            var visitor = Mock.Of <ITestStepVisitor>();

            // Act
            setClassStep.Accept(visitor);

            // Assert
            Mock.Get(visitor)
            .Verify(v => v.Visit(setClassStep));
        }
예제 #2
0
        public void ShouldSetNameSpaceAndClass()
        {
            // Arrange
            var setClassStep = new SetClassStep();

            setClassStep.QualifiedName = "TestAssembly.TestNameSpace.TestClass1, TestAssembly";
            setClassStep.Accept(visitor);

            // Act
            var result = visitor.Build();

            // Assert
            result.ShouldContain("namespace TestAssembly.TestNameSpace");
            result.ShouldContain("public class TestClass1");
        }
예제 #3
0
        public void ShouldCreatePlaceHolder_WhenClassHasNoNamespace()
        {
            // Arrange
            var setClassStep = new SetClassStep();

            setClassStep.QualifiedName = "TestClass1, TestAssembly";
            setClassStep.Accept(visitor);

            // Act
            var result = visitor.Build();

            // Assert
            result.ShouldContain("namespace <NAMESPACE>");
            result.ShouldNotContain("public class <CLASS>");
        }