public void ReadContentWithEnvironment_NotExistingFile_ThrowsFileNotFoundException() { // Arrange var reader = new ReaderFixture().CreateFileReader("Config\\Json\\CopyConfig.json"); // Act Action action = () => reader.ReadContent("test"); // assert action.Should().Throw <FileNotFoundException>(); }
public void ReadContentWithEnvironment_ExistingFile_NotEmptyResult() { // Arrange var reader = new ReaderFixture().CreateFileReader("Config\\Json\\CopyConfig.json"); // Act var content = reader.ReadContent("dev"); // assert content.Should().NotBeEmpty(); }
public void ReadContent_ExistingFile_NotEmptyResult() { // Arrange var reader = new ReaderFixture().CreateEmbeddedResourceReader("Config.Json.ResourceConfig.json"); // Act var content = reader.ReadContent(); // assert content.Should().NotBeEmpty(); }
public void ReadContentWithEnvironment_NotExistingFile_ThrowsArgumentException() { // Arrange var reader = new ReaderFixture().CreateEmbeddedResourceReader("Config.Json.ResourceConfig.json"); // Act Action action = () => reader.ReadContent("test"); // assert action.Should().Throw <ArgumentException>(); }
public void ProcessContentForEnvironment_ExistingFiles_LastFileOverrides() { // Arrange var reader = new ReaderFixture().CreateEmbeddedResourceReader("Config.Json.ResourceConfig.json"); var jsonProcessor = new JsonProcessor <Configuration>(); // Act var merged = jsonProcessor.ProcessContentForEnvironment(reader, "dev"); // Assert merged.ClientId.Should().Be("api_client_dev"); merged.ClientSecret.Should().Be("client_secret_dev"); }