public void SerializeSecurityRequirementWithReferencedSecuritySchemeAsV3JsonWorks() { // Arrange var expected = @"{ ""scheme1"": [ ""scope1"", ""scope2"", ""scope3"" ], ""scheme2"": [ ""scope4"", ""scope5"" ], ""scheme3"": [ ] }"; // Act var actual = SecurityRequirementWithReferencedSecurityScheme.SerializeAsJson(OpenApiSpecVersion.OpenApi3_0); // Assert actual = actual.MakeLineBreaksEnvironmentNeutral(); expected = expected.MakeLineBreaksEnvironmentNeutral(); actual.Should().Be(expected); }
public void SerializeBasicSecurityRequirementAsV3JsonWorks() { // Arrange var expected = @"{ }"; // Act var actual = BasicSecurityRequirement.SerializeAsJson(OpenApiSpecVersion.OpenApi3_0); // Assert actual = actual.MakeLineBreaksEnvironmentNeutral(); expected = expected.MakeLineBreaksEnvironmentNeutral(); actual.Should().Be(expected); }
SerializeSecurityRequirementWithUnreferencedSecuritySchemeAsV3JsonShouldSkipUnserializableKeyValuePair() { // Arrange var expected = @"{ ""scheme1"": [ ""scope1"", ""scope2"", ""scope3"" ], ""scheme3"": [ ] }"; // Act var actual = SecurityRequirementWithUnreferencedSecurityScheme.SerializeAsJson(OpenApiSpecVersion.OpenApi3_0); // Assert actual = actual.MakeLineBreaksEnvironmentNeutral(); expected = expected.MakeLineBreaksEnvironmentNeutral(); actual.Should().Be(expected); }