public void AddSecureObjectOutput_WithValueMapping_ShouldAddObjectOutputValueWithNestedStringOutputValueToOutputsPropertyAndSetIsSecureToTrue() { // Arrange var template = new TestTemplate(); var key = "key"; var nestedKey = "nestedKey"; var nestedValue = "nestedValue"; var mapping = new Dictionary <string, string> { { nestedKey, nestedValue } }; // Act template.AddSecureObjectOutput(key, mapping); // Assert template.Outputs.Should().HaveCount(1); template.Outputs.First().Key.Should().Be(key); template.Outputs.First().Value.Should().BeOfType <ObjectOutputValue>(); template.Outputs.First().Value.HasValue.Should().BeTrue(); template.Outputs.First().Value.As <ObjectOutputValue>().IsSecure.Should().BeTrue(); template.Outputs.First().Value.As <ObjectOutputValue>().Value[nestedKey].Should().BeOfType <StringOutputValue>(); template.Outputs.First().Value.As <ObjectOutputValue>().Value[nestedKey].As <StringOutputValue>().IsObject.Should().BeFalse(); template.Outputs.First().Value.As <ObjectOutputValue>().Value[nestedKey].As <StringOutputValue>().IsSecure.Should().BeFalse(); template.Outputs.First().Value.As <ObjectOutputValue>().Value[nestedKey].As <StringOutputValue>().Value.Should().Be(nestedValue); }
public void AddSecureObjectOutput_WithStringValue_ShouldAddStringOutputValueToOutputsPropertyAndSetIsSecureToTrue() { // Arrange var template = new TestTemplate(); var key = "key"; var value = "value"; // Act template.AddSecureObjectOutput(key, value); // Assert template.Outputs.Should().HaveCount(1); template.Outputs.First().Key.Should().Be(key); template.Outputs.First().Value.Should().BeOfType <StringOutputValue>(); template.Outputs.First().Value.HasValue.Should().BeTrue(); template.Outputs.First().Value.As <StringOutputValue>().IsObject.Should().BeTrue(); template.Outputs.First().Value.As <StringOutputValue>().IsSecure.Should().BeTrue(); template.Outputs.First().Value.As <StringOutputValue>().Value.Should().Be(value); }