public static void WriteGlossary(string domainAssembly, string outputFile) { var publisher = new JsonGlossaryPublishingService(); var inputModel = new GlossaryInputModel { DomainAssemblyFile = domainAssembly, GlossaryOutputFile = outputFile }; publisher.Publish(inputModel); }
public void Publish_invalid_GlossaryOutputFile_throws_exception(string invalidGlossaryOutputFile) { var inputModel = new GlossaryInputModel { DomainAssemblyFile = "c:/temp/dll", GlossaryOutputFile = invalidGlossaryOutputFile }; var sut = new JsonGlossaryPublishingService(); Should.Throw <ArgumentException>(() => sut.Publish(inputModel)); }
public void Publish_publishes_file_to_GlossaryFileWriter() { // Arrange var directory = Directory.GetCurrentDirectory() + "/../../../../Sample/"; var outputFile = directory + "output.json"; var sut = new JsonGlossaryPublishingService(); var inputModel = new GlossaryInputModel { DomainAssemblyFile = directory + InputAssembly, GlossaryOutputFile = outputFile }; // Act sut.Publish(inputModel); // Assert var outputContents = File.ReadAllText(outputFile); outputContents.Contains("Customer").ShouldBeTrue(); }