public async Task Register_When_UnKnown_Access_Point()
        {
            var assertDatabase = await RfidDatabaseAssert.CreateAsync();

            var userRM        = Examples.Administrator();
            var accessPointRM = Examples.AccessPoint();

            await RfidHttpClient.RegisterUserAsync(userRM);

            using (var authTokenResponseMessage = await RfidHttpClient.GenerateAuthTokenAsync(userRM))
            {
                var authToken = await AuthTokenHelper.FromHttpResponseMessageAsync(authTokenResponseMessage);

                var token = await authToken.GetTokenAsync();

                using (var httpResponse = await RfidHttpClient.CheckAccessAsync("unknown", accessPointRM.SerialNumber))
                {
                    RfidAssert.AssertHttpResponse(httpResponse, System.Net.HttpStatusCode.NotFound);
                }

                using (var httpResponse = await RfidHttpClient.RegisterAccessPointAsync(accessPointRM, token))
                {
                    RfidAssert.AssertHttpResponse(httpResponse, System.Net.HttpStatusCode.OK);
                }
            }

            await assertDatabase.AssertCntAsync(userRM, accessPointRM, new UnKnownTagMock { Number = "unknown" });
        }
        public async Task Check_Access_Level_Sufficient_3()
        {
            var assertDatabase = await RfidDatabaseAssert.CreateAsync();

            var userRM      = Examples.Administrator();
            var tagRM       = Examples.Tag("test", (int)AccessLevel.Mid, "test");
            var accessPoint = Examples.AccessPoint("test", "test", AccessLevel.Low);

            await RfidHttpClient.RegisterUserAsync(userRM);

            using (var tokenResponse = await RfidHttpClient.GenerateAuthTokenAsync(userRM))
            {
                var authToken = await AuthTokenHelper.FromHttpResponseMessageAsync(tokenResponse);

                var token = await authToken.GetTokenAsync();

                using (var registerTagResponse = await RfidHttpClient.RegisterTagAsync(tagRM, token))
                    using (var registerAccessPointResponse = await RfidHttpClient.RegisterAccessPointAsync(accessPoint, token))
                        using (var checkAccessResponse = await RfidHttpClient.CheckAccessAsync(tagRM.Number, accessPoint.SerialNumber))
                        {
                            RfidAssert.AssertHttpResponse(checkAccessResponse, System.Net.HttpStatusCode.OK);
                        }
            }

            await assertDatabase.AssertCntAsync(userRM, tagRM, accessPoint);
        }
        public async Task Check_Access_Level_When_Access_Point_Serial_Number_Does_Not_Exists()
        {
            var assertDatabase = await RfidDatabaseAssert.CreateAsync();

            var userRM      = Examples.Administrator();
            var tagRM       = Examples.Tag("test", (int)AccessLevel.Mid, "test");
            var accessPoint = Examples.AccessPoint("test", "test", AccessLevel.Mid);

            await RfidHttpClient.RegisterUserAsync(userRM);

            using (var tokenResponse = await RfidHttpClient.GenerateAuthTokenAsync(userRM))
            {
                var authToken = await AuthTokenHelper.FromHttpResponseMessageAsync(tokenResponse);

                var token = await authToken.GetTokenAsync();

                using (var registerTagResponse = await RfidHttpClient.RegisterTagAsync(tagRM, token))
                    using (var registerAccessPointResponse = await RfidHttpClient.RegisterAccessPointAsync(accessPoint, token))
                        using (var checkAccessResponse = await RfidHttpClient.CheckAccessAsync(tagRM.Number, "unknown"))
                        {
                            RfidAssert.AssertHttpResponse(checkAccessResponse, System.Net.HttpStatusCode.NotFound);
                        }
            }

            await assertDatabase.AssertCntAsync(userRM, tagRM, accessPoint, Examples.UnKnownAccessPoint("unknown"));
        }
        public async Task Check_Access_Level_When_Invalid_Data(String tagNumber, String accessPointSerialNumber)
        {
            var assertDatabase = await RfidDatabaseAssert.CreateAsync();

            using (var checkAccessResponse = await RfidHttpClient.CheckAccessAsync(tagNumber, accessPointSerialNumber))
            {
                RfidAssert.AssertHttpResponse(checkAccessResponse, System.Net.HttpStatusCode.BadRequest);
            }

            await assertDatabase.AssertCntAsync();
        }