Example #1
0
        public void ProxyModelMetadataInfoComplexTypeModelTests()
        {
            var contentResult = GetResolvedContentResult(TypesModelHelper.GetComplexTypeModel());

            var expect = new Dictionary <string, string>()
            {
                ["Bar.String"]   = "Bar string value!",
                ["Bar.SomeEnum"] = "Value0",
                ["Bar.someint"]  = "6",
                ["Bar.Foo.IEnumerableInt[0]"] = "2",
                ["Bar.Foo.IEnumerableInt[1]"] = "3",
                ["Bar.Foo.String"]            = "Foo inner str value!",
                ["Bool"] = "True",
                ["Foo.IEnumerableInt[0]"] = "4",
                ["Foo.IEnumerableInt[1]"] = "5",
                ["Foo.String"]            = "Foo string value!",
                ["Byte"]            = "65",
                ["Char"]            = "c",
                ["DateTime"]        = "1/1/2018 9:00:00 AM",
                ["DateTimeOffset"]  = "1/1/2018 9:00:00 AM +03:00",
                ["Decimal"]         = "300.5",
                ["DecimalNullable"] = "100.5",
                ["Double"]          = "1700",
                ["Float"]           = "4.5",
                ["Guid"]            = "5cb98c19-7c0c-4661-bd9a-a2042b3bcb0d",
                ["IEnumerable[0]"]  = "value1",
                ["IEnumerable[1]"]  = "value2",
                ["IEnumerable[2]"]  = "value3",
                ["ICollection[0]"]  = "2",
                ["ICollection[1]"]  = "4",
                ["ICollection[2]"]  = "6",
                ["ICollection[3]"]  = "8",
                ["Int"]             = "2147483647",
                ["IntArray[0]"]     = "2147483647",
                ["IntArray[1]"]     = "-2147483648",
                ["Long"]            = "4294967296",
                ["Object.a"]        = "1",
                ["Object.b"]        = "True",
                ["Object.c"]        = "str",
                ["SByte"]           = "-102",
                ["Short"]           = "1034",
                ["String"]          = "string value!",
                ["TimeSpan"]        = "04:15:30",
                ["UInt"]            = "3000000000",
                ["ULong"]           = "7934076125",
                ["Uri"]             = "http://localhost:5003/",
                ["UShort"]          = "65034"
            };

            var actual = contentResult.Dictionary;
            var str    = string.Join(Environment.NewLine, actual.OrderBy(x => x.Key).Select(x => $"[\"{x.Key}\"] = \"{x.Value}\",").ToArray());

            Assert.Equal(expect, actual);
            Assert.Equal(41, actual.Count);
        }
Example #2
0
 public async Task GetComplexTypeTest()
 {
     var   guidelineApi = Resolver.GetService <IGuidelineApi>();
     var   task         = guidelineApi.GetComplexType(TypesModelHelper.GetComplexTypeModel());
     await task;
 }
Example #3
0
 public async Task TaskCallHttpPostWithReferenceTypeParameterTest()
 {
     Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("tr-TR");
     var guidelineApi = Resolver.GetService <IGuidelineApi>();
     await guidelineApi.TaskComplexTypeModel(TypesModelHelper.GetComplexTypeModel());
 }