public void ShouldCallWriterWithGeneratedClassStatement() { // Given var projectAssembly = "ProjectAssembly"; var sourceDirectory = ""; var sourceFileName = "MultipleGeneration.d.ts"; var sourceFile = Path.Combine( ".", "SourceFiles", sourceFileName ); var sourceFiles = new List <string> { sourceFile }; var generationList = new List <string> { "Vector3", }; var typeOverrideMap = new Dictionary <string, string>(); var writerMock = new Mock <IWriter>(); // When var generateSource = new GenerateInteropSource(); var actual = default(IList <GeneratedStatement>); writerMock.Setup( mock => mock.Write( It.IsAny <IList <GeneratedStatement> >() ) ).Callback <IList <GeneratedStatement> >( (generatedStatement) => { actual = generatedStatement; } ); generateSource.Run( projectAssembly, sourceDirectory, sourceFiles, generationList, writerMock.Object, new NoFormattingTextFormatter(), typeOverrideMap ); // Then actual.Should().NotBeNull(); actual.Should().HaveCount(5); }
public void ShouldGenerateSourceForEverythingDefinition() { // Given var projectAssembly = "ProjectAssembly"; var sourceDirectory = ""; var sourceFileName = "MultipleGeneration.d.ts"; var sourceFile = Path.Combine( ".", "SourceFiles", sourceFileName ); var sourceFiles = new List <string> { sourceFile }; var generationList = new List <string> { "Mesh", "Mesh", "Engine", "Vector3", }; var typeOverrideMap = new Dictionary <string, string>(); var writerMock = new Mock <IWriter>(); // When var generateSource = new GenerateInteropSource(); var actual = generateSource.Run( projectAssembly, sourceDirectory, sourceFiles, generationList, writerMock.Object, new NoFormattingTextFormatter(), typeOverrideMap ); // Then actual.Should().BeTrue(); }