public void ExampleIsValid() { SslConfigLoader.Cert result = SslConfigLoader.LoadCertJson(Path.Combine(TransportDir, ".cert.example.Json")); Assert.That(result.path, Is.EqualTo("./certs/MirrorLocal.pfx")); Assert.That(result.password, Is.EqualTo("")); }
public void ThrowsIfBadJson(string path) { InvalidDataException exception = Assert.Throws <InvalidDataException>(() => { SslConfigLoader.LoadCertJson(Path.Combine(TestDir, path)); }); Assert.That(exception.Message, Does.StartWith("Cert Json didnt not contain \"path\"")); }
public void ThrowsIfCantFindJson() { FileNotFoundException exception = Assert.Throws <FileNotFoundException>(() => { SslConfigLoader.LoadCertJson(Path.Combine(TestDir, "NotARealFile.Json")); }); Assert.That(exception.Message, Does.StartWith("Could not find file ")); }
public void ValidConfig(string jsonPath, string expectedPath, string expectedPassowrd) { SslConfigLoader.Cert cert = SslConfigLoader.LoadCertJson(Path.Combine(TestDir, jsonPath)); Assert.That(cert.path, Is.EqualTo(expectedPath)); Assert.That(cert.password, Is.EqualTo(expectedPassowrd)); }