public void Accept_ShouldBeVisited() { // Arrange var visitor = Mock.Of <ITestStepVisitor>(); // Act setClassStep.Accept(visitor); // Assert Mock.Get(visitor) .Verify(v => v.Visit(setClassStep)); }
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"); }
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>"); }