Beispiel #1
0
        public void GivenFormatAndNoVariable()
        {
            var format = "some value: {nullvariable}";
            var result = DescriptionProvider.GetDescription(format, null);

            result.Should().Be(@"some value: {nullvariable}");
        }
Beispiel #2
0
        public void GivenFormatAndMatchingCompoundVariable()
        {
            var format = "some value: {parent.variable}";
            var values = JObject.Parse(@"{ ""parent"": { ""variable"": ""Value"" }}");
            var result = DescriptionProvider.GetDescription(format, values);

            result.Should().Be(@"some value: Value");
        }
Beispiel #3
0
        public void GivenFormatAndMatchingStringVariables()
        {
            var format = "some value: {variable1}, other value: {variable2}";
            var values = JObject.Parse(@"{ ""variable1"": ""Value1"", ""variable2"": ""Value2"" }");
            var result = DescriptionProvider.GetDescription(format, values);

            result.Should().Be(@"some value: Value1, other value: Value2");
        }
Beispiel #4
0
        public void GivenFormatAndNotMatchingStringVariable()
        {
            var format = "some value: {variable}";
            var values = JObject.Parse(@"{ ""otherVariable"": ""Value"" }");
            var result = DescriptionProvider.GetDescription(format, values);

            result.Should().Be(@"some value: {variable}");
        }
Beispiel #5
0
 public string GetDescription(string format)
 {
     return(DescriptionProvider.GetDescription(format, DescriptionValues));
 }