public void CreateSolution_Create_ThrowsWithSnippet() { var writer = Substitute.For <IFileWriter>(); var output = Substitute.For <IFile>(); var sut = new CreateSolution(writer); var act = () => sut.Create(output); act.Should().Throw <NotSupportedException>(); }
public void CreateSolution_Create_WritesFIle() { var writer = Substitute.For <IFileWriter>(); var output = Substitute.For <ISolution>(); var project = Substitute.For <IProject>(); var fileGroup = Substitute.For <IFileGroup>(); var file = Substitute.For <IFile>(); output.Projects.Returns(new [] { project }); output.Files.Returns(new [] { file }); project.FileGroups.Returns(new [] { fileGroup }); fileGroup.Files.Returns(new [] { file }); var sut = new CreateSolution(writer); sut.Create(output); writer.ReceivedCalls().Should().HaveCount(2); }