Beispiel #1
0
 public void NewtonsoftTest()
 {
     TestUtil.UseNewtonsoftJson(JSend.Success());
     TestUtil.UseNewtonsoftJson(JSend.Success(new { ABC = "abc" }));
     TestUtil.UseNewtonsoftJson(JSend.Fail());
     TestUtil.UseNewtonsoftJson(JSend.Fail(new Dictionary <string, string> {
         ["ABC"] = "abc"
     }));
     TestUtil.UseNewtonsoftJson(JSend.Error("error message"));
     TestUtil.UseNewtonsoftJson(JSend.Error("error message", "#0", new Dictionary <string, string> {
         ["ABC"] = "abc"
     }));
 }
Beispiel #2
0
        public void StatusTest()
        {
            Assert.True(JSend.Success().IsSuccess());
            Assert.False(JSend.Success().IsFail());
            Assert.False(JSend.Success().IsError());

            Assert.False(JSend.Fail().IsSuccess());
            Assert.True(JSend.Fail().IsFail());
            Assert.False(JSend.Fail().IsError());

            Assert.False(JSend.Error("").IsSuccess());
            Assert.False(JSend.Error("").IsFail());
            Assert.True(JSend.Error("").IsError());
        }