//public static void Assert04(AuthControllerTestRepository authControllerTestRepository, HttpResponseMessage acualRessult) //{ // Assert.Equal(HttpStatusCode.Unauthorized, acualRessult.StatusCode); // var result = JObject.Parse(acualRessult.Content.ReadAsStringAsync().Result); // Assert.Equal("1001", result["ErrorCode"]); // Assert.Equal("Not Match SimAndDevice Info", result["ErrorMessage"]); // var deauthentication = authControllerTestRepository.GetDeauthentication(); // Assert.Empty(deauthentication); // var simDeviceAuthenticationStateDones = authControllerTestRepository.GetSimAndDeviceAuthenticated(); // Assert.Empty(simDeviceAuthenticationStateDones); // var multiFactorAuthenticationStateDones = authControllerTestRepository.GetMultiFatorAuthenticationDone(); // Assert.Empty(multiFactorAuthenticationStateDones); // var radreply = authControllerTestRepository.GetRadreplys("user1@jincreek2"); // Assert.Single(radreply); // Assert.Equal("NwAddress", radreply.First().Value); //} //public static void Assert05(AuthControllerTestRepository authControllerTestRepository, HttpResponseMessage acualRessult) //{ // Assert.Equal(HttpStatusCode.Unauthorized, acualRessult.StatusCode); // var result = JObject.Parse(acualRessult.Content.ReadAsStringAsync().Result); // Assert.Equal("1001", result["ErrorCode"]); // Assert.Equal("Not Match SimAndDevice Info", result["ErrorMessage"]); // var deauthentication = authControllerTestRepository.GetDeauthentication(); // Assert.Empty(deauthentication); // var simDeviceAuthenticationStateDones = authControllerTestRepository.GetSimAndDeviceAuthenticated(); // // 関連ないSimDeviceAuthenticationStateDoneを入れているのでcount=1を確認 // Assert.Equal(1, simDeviceAuthenticationStateDones.Count); // var multiFactorAuthenticationStateDones = authControllerTestRepository.GetMultiFatorAuthenticationDone(); // Assert.Empty(multiFactorAuthenticationStateDones); // var radreply = authControllerTestRepository.GetRadreplys("user1@jincreek2"); // Assert.Single(radreply); // Assert.Equal("NwAddress", radreply.First().Value); //} public static void Assert06To07(AuthControllerTestRepository authControllerTestRepository, HttpResponseMessage acualRessult) { Assert.Equal(HttpStatusCode.OK, acualRessult.StatusCode); Assert.Equal("", acualRessult.Content.ReadAsStringAsync().Result); //var result = JObject.Parse(acualRessult.Content.ReadAsStringAsync().Result); //Assert.Equal("1002", result["ErrorCode"]); //Assert.Equal("Not Match MultiFactor Info", result["ErrorMessage"]); var deauthentication = authControllerTestRepository.GetDeauthentication(); Assert.Empty(deauthentication); var simDeviceAuthenticationStateDones = authControllerTestRepository.GetAllSimAndDeviceAuthenticated(); Assert.Empty(simDeviceAuthenticationStateDones); var multiFactorAuthenticationStateDones = authControllerTestRepository.GetMultiFatorAuthenticationDone(); Assert.Empty(multiFactorAuthenticationStateDones); var radreply = authControllerTestRepository.GetRadreplys("user1@jincreek2"); Assert.Single(radreply); Assert.Equal("Nw2Address", radreply.First().Value); }
public static void Assert01And02And10To21(AuthControllerTestRepository authControllerTestRepository, HttpResponseMessage acualRessult) { Assert.Equal(HttpStatusCode.BadRequest, acualRessult.StatusCode); var result = JObject.Parse(acualRessult.Content.ReadAsStringAsync().Result); Assert.NotNull(result["traceId"]); Assert.Equal("One or more validation errors occurred.", result["title"]); Assert.Equal("400", result["status"]); var deauthentication = authControllerTestRepository.GetDeauthentication(); Assert.Empty(deauthentication); var simDeviceAuthenticationStateDones = authControllerTestRepository.GetAllSimAndDeviceAuthenticated(); Assert.Empty(simDeviceAuthenticationStateDones); var multiFactorAuthenticationStateDones = authControllerTestRepository.GetMultiFatorAuthenticationDone(); Assert.Empty(multiFactorAuthenticationStateDones); var radreply = authControllerTestRepository.GetRadreplys("user1@jincreek2"); Assert.Single(radreply); Assert.Equal("NwAddress", radreply.First().Value); }