public void CreateDataCase17()
        {
            CreateBaseData();

            var simAndDeviceAuthenticated = new SimAndDeviceAuthenticated()
            {
                SimAndDevice = SimAndDevice1,
                Expiration   = CurrentDateTimeForLessThanStart.Item2
            };

            MainDbContext.AddRange(simAndDeviceAuthenticated);
            SimAndDevice1.SimAndDeviceAuthenticated = simAndDeviceAuthenticated;

            var multiFactorAuthenticated = new MultiFactorAuthenticated()
            {
                MultiFactor = MultiFactor1,
                Expiration  = CurrentDateTimeForLessThanStart.Item2
            };

            MainDbContext.AddRange(multiFactorAuthenticated);
            MultiFactor1.MultiFactorAuthenticated = multiFactorAuthenticated;

            MainDbContext.SaveChanges();
            RadiusDbContext.SaveChanges();
        }
Exemplo n.º 2
0
        public void Case18()
        {
            SetUpData();
            for (int i = 1; i <= 8; i++)
            {
                var multiFactor = new MultiFactor // 組織 : '自組織
                {
                    SimAndDevice = _simDevice1,
                    EndUser      = _user2,
                    ClosedNwIp   = $"127.0.0.{i:00}",
                    StartDate    = DateTime.Parse($"2020-02-{i:00}"),
                    EndDate      = DateTime.Parse($"2021-02-{i:00}"),
                };
                var multiFactorAuthenticated = new MultiFactorAuthenticated()
                {
                    MultiFactor = multiFactor,
                    Expiration  = DateTime.Now
                };
                _context.AddRange(multiFactor, multiFactorAuthenticated);
            }
            _context.SaveChanges();
            var(response, _, json) = Utils.Get(_client, $"{Url}/?OrganizationCode={_org1.Code}&page=3&pageSize=3&Msisdn=msisdn&DeviceName=device&startDateFrom=2019-12-29&startDateTo=2020-02-27&endDateFrom=2020-12-29&endDateTo=2021-02-27&IsAuthenticationDone=True&sortBy=endDate&orderBy=asc", "user0", "user0"); //    スーパー管理者
            var list = (JArray)json["results"];

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.True(3 > list.Count); //'指定件数未満
            Assert.Equal(8, (int)json["count"]);
            Assert.Equal("2021-02-07", list[0]["endDate"]);
            Assert.Equal("2021-02-08", list[1]["endDate"]); // 利用終了日ソート:'昇順
        }
Exemplo n.º 3
0
        public void Case13()
        {
            SetUpData();
            for (int j = 1; j <= 2; j++)
            {
                for (int i = 1; i <= 25; i++)
                {
                    var multiFactor = new MultiFactor // 組織 : '自組織
                    {
                        SimAndDevice = _simDevice1,
                        EndUser      = _user2,
                        ClosedNwIp   = $"127.0.0.1",
                        StartDate    = DateTime.Parse($"2020-{j:00}-{i:00}"),
                        EndDate      = DateTime.Parse($"2021-{j:00}-{i:00}"),
                    };
                    var multiFactorAuthenticated = new MultiFactorAuthenticated()
                    {
                        MultiFactor = multiFactor,
                        Expiration  = DateTime.Now
                    };
                    _context.AddRange(multiFactor, multiFactorAuthenticated);
                }
            }
            _context.SaveChanges();
            var(response, _, json) = Utils.Get(_client, $"{Url}/?OrganizationCode={_org1.Code}&page=2&Msisdn=msisdn&DeviceName=device&startDateFrom=2019-12-29&startDateTo=2020-02-27&endDateFrom=2020-12-29&endDateTo=2021-02-27&IsAuthenticationDone=True&sortBy=startDate&orderBy=desc", "user1", "user1", 1, _domain1.Name); // ユーザー管理者
            var list = (JArray)json["results"];

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal(20, list.Count);
            Assert.Equal(50, (int)json["count"]);
            Assert.Equal("2020-02-05", list[0]["startDate"]);
            Assert.Equal("2020-02-04", list[1]["startDate"]); // 利用開始日ソート:'降順
        }
Exemplo n.º 4
0
        private DeauthenticationLog CreateDeauthenticationLog(MultiFactorAuthenticated multiFactorAuthenticated)
        {
            var deauthenticationLog = new DeauthenticationLog
            {
                MultiFactor = multiFactorAuthenticated.MultiFactor,
                Time        = DateTime.Now,
                Sim         = multiFactorAuthenticated.MultiFactor.SimAndDevice.Sim
            };

            return(deauthenticationLog);
        }
        public void CreateDataCase04()
        {
            CreateBaseData();

            var multiFactorAuthenticated = new MultiFactorAuthenticated()
            {
                MultiFactor = MultiFactor1,
                Expiration  = CurrentDateTimeForEnd.Item2
            };

            MainDbContext.AddRange(multiFactorAuthenticated);
            MultiFactor1.MultiFactorAuthenticated = multiFactorAuthenticated;

            MainDbContext.SaveChanges();
            RadiusDbContext.SaveChanges();
        }
        public void SetUpInsertDataForDeauthenticationCase21()
        {
            var simDevice = SetUpInsertDataForDeauthenticationCase13();
            var simDeviceAuthenticationStateDone = new SimAndDeviceAuthenticated
            {
                Expiration = DateTime.Now.AddHours(1.00)
            };

            simDevice.SimAndDeviceAuthenticated = simDeviceAuthenticationStateDone;
            MainDbContext.SimAndDeviceAuthenticated.Add(simDeviceAuthenticationStateDone);
            var factorCombination = CreateUser6(simDevice);
            var multiFactorAuthenticationStateDone = new MultiFactorAuthenticated
            {
                Expiration = DateTime.Now.AddHours(1.00)
            };

            factorCombination.MultiFactorAuthenticated = multiFactorAuthenticationStateDone;
            MainDbContext.MultiFactorAuthenticated.Add(multiFactorAuthenticationStateDone);
            MainDbContext.SaveChanges();
        }
Exemplo n.º 7
0
        public void Case15()
        {
            for (int i = 1; i <= 6; i++)
            {
                var multiFactor = new MultiFactor // 組織 : '自組織 認証済み:'フィルターに合致
                {
                    SimAndDevice = _simDevice1,
                    EndUser      = _user3,
                    ClosedNwIp   = $"127.0.0.{i:00}",
                    StartDate    = DateTime.Parse("2020-02-09"),
                    EndDate      = DateTime.Parse("2021-02-07"),
                };
                var multiFactorAuthenticated = new MultiFactorAuthenticated()
                {
                    MultiFactor = multiFactor,
                    Expiration  = DateTime.Now
                };
                _context.AddRange(multiFactor, multiFactorAuthenticated);
            }
            _context.Add(new MultiFactor // 組織 : '自組織 認証済み:'フィルターに合致せず
            {
                SimAndDevice = _simDevice1,
                EndUser      = _user3,
                ClosedNwIp   = "127.0.0.1",
                StartDate    = DateTime.Parse("2020-02-09"),
                EndDate      = DateTime.Parse("2021-02-07"),
            });
            _context.SaveChanges();
            var(response, _, json) = Utils.Get(_client, $"{Url}/?OrganizationCode={_org1.Code}&page=2&pageSize=2&IsAuthenticationDone=True&sortBy=ClosedNwIp&orderBy=desc", "user0", "user0"); //    スーパー管理者
            var list = (JArray)json["results"];

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal(2, list.Count);
            Assert.Equal(6, (int)json["count"]);
            Assert.Equal("127.0.0.04", list[0]["closedNwIp"]);
            Assert.Equal("127.0.0.03", list[1]["closedNwIp"]); // 閉域NW IPアドレスソート:'降順
        }