Exemple #1
0
            public static void Assert01_02_03_15(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 multiFactorAuthenticationLogFails =
                    authControllerTestRepository.GetMultiFactorAuthenticationLogFail();

                Assert.Empty(multiFactorAuthenticationLogFails);
                var multiFactorAuthenticationLogSuccesses =
                    authControllerTestRepository.GetMultiFatorAuthenticationLogSuccess();

                Assert.Empty(multiFactorAuthenticationLogSuccesses);
                var multiFactorAuthenticationStateDones =
                    authControllerTestRepository.GetMultiFatorAuthenticationDone();

                Assert.Empty(multiFactorAuthenticationStateDones);

                var radreplys = authControllerTestRepository.GetRadreplys("user1@jincreek2");

                Assert.Single(radreplys);
                Assert.Equal("Nw2Address", radreplys.First().Value);
            }
Exemple #2
0
            public static void Assert06(AuthControllerTestRepository authControllerTestRepository,
                                        HttpResponseMessage acualRessult)
            {
                Assert.Equal(HttpStatusCode.Unauthorized, acualRessult.StatusCode);
                var result = JObject.Parse(acualRessult.Content.ReadAsStringAsync().Result);

                Assert.Equal("1003", result["ErrorCode"]);
                Assert.Equal("Not Match AuthId Info", result["ErrorMessage"]);
                var multiFactorAuthenticationStateDones =
                    authControllerTestRepository.GetMultiFatorAuthenticationDone();

                Assert.Empty(multiFactorAuthenticationStateDones);
                var multiFactorAuthenticationLogSuccesses =
                    authControllerTestRepository.GetMultiFatorAuthenticationLogSuccess();

                Assert.Empty(multiFactorAuthenticationLogSuccesses);
                var multiFactorAuthenticationLogFails =
                    authControllerTestRepository.GetMultiFactorAuthenticationLogFail();

                Assert.Empty(multiFactorAuthenticationLogFails);
            }