コード例 #1
0
 public async Task JsonAsync()
 {
     var result = new Models.ModelSimple()
     {
         Age      = 0,
         Comments = "Comment",
         IsValid  = true,
         Name     = "Test",
     };
     await FileLogger.JsonAsync(result);
 }
コード例 #2
0
        public void TrimModel()
        {
            var model = new Models.ModelSimple()
            {
                Age      = 0,
                Comments = " Comment ",
                IsValid  = true,
                Name     = " Test "
            };

            var result = new Models.ModelSimple()
            {
                Age      = 0,
                Comments = "Comment",
                IsValid  = true,
                Name     = "Test"
            };

            StringExtensions.TrimModel <Models.ModelSimple>(model);

            Assert.Equal(result.Comments, model.Comments);
            Assert.Equal(result.Name, model.Name);
        }