Ejemplo n.º 1
0
        public void Case01()
        {
            GeneralUser user = new GeneralUser
            {
                AccountName = "User03",
                Domain      = _domain,
                Name        = "user03",
                AuthenticateWhenUnlockingScreen = true
            };
            UserGroupEndUser userGroupEndUser = new UserGroupEndUser()
            {
                UserGroup = _userGroup1,
                EndUser   = user
            };

            _context.Add(user);
            _context.AddRange(userGroupEndUser);
            _context.SaveChanges();
            var token = Utils.GetAccessToken(_client, "user1", "user1", 1, "domain"); // ユーザー管理者
            var obj   = new
            {
                AuthenticateWhenUnlockingScreen = false
            };
            var result = Utils.Put(_client, $"{Url}/", Utils.CreateJsonContent(obj), token);
            var body   = result.Content.ReadAsStringAsync().Result;

            Assert.Equal(HttpStatusCode.Forbidden, result.StatusCode);
            Assert.Empty(body);
        }
        private void CreateUserRecords()
        {
            var userGroup = new UserGroup()
            {
                Domain     = Domain,
                Name       = "UserGroup",
                AdObjectId = Guid.NewGuid()
            };

            GeneralUser1 = new GeneralUser()
            {
                AccountName = "GeneralUser1",
                Name        = "GU1",
                Domain      = Domain,
                AuthenticateWhenUnlockingScreen = true,
                AdObjectId = Guid.NewGuid()
            };

            var availablePeriod = new AvailablePeriod()
            {
                EndUser   = GeneralUser1,
                StartDate = CurrentDateTimeForStart.Item1,
                EndDate   = CurrentDateTimeForStart.Item2
            };

            var userGroupEndUser = new UserGroupEndUser()
            {
                UserGroup = userGroup,
                EndUser   = GeneralUser1
            };

            MainDbContext.AddRange(userGroup, GeneralUser1, availablePeriod, userGroupEndUser);
        }
Ejemplo n.º 3
0
        public void Case06()
        {
            GeneralUser user2 = new GeneralUser
            {
                AccountName = "User02",
                Domain      = _domain21,
                Name        = "user02",
                AuthenticateWhenUnlockingScreen = true
            };
            UserGroupEndUser userGroupEndUser = new UserGroupEndUser()
            {
                UserGroup = _userGroup2,
                EndUser   = user2
            };

            _context.AddRange(user2);
            _context.AddRange(userGroupEndUser);
            _context.SaveChanges();
            var token = Utils.GetAccessToken(_client, "user1", "user1", 1, "domain"); // ユーザー管理者
            var obj   = new
            {
                AuthenticateWhenUnlockingScreen = false
            };
            var result = Utils.Put(_client, $"{Url}/{user2.Id}", Utils.CreateJsonContent(obj), token);
            var body   = result.Content.ReadAsStringAsync().Result;
            var json   = JObject.Parse(body);

            Assert.Equal(HttpStatusCode.Forbidden, result.StatusCode);
            Assert.NotNull(json["traceId"]);
            Assert.NotNull(json["errors"]["Role"]);
        }
Ejemplo n.º 4
0
        public void Case05()
        {
            GeneralUser user = new GeneralUser
            {
                AccountName = "User03",
                Domain      = _domain11,
                Name        = "User03",
                AuthenticateWhenUnlockingScreen = true
            };
            UserGroupEndUser userGroupEndUser = new UserGroupEndUser()
            {
                UserGroup = _userGroup1,
                EndUser   = user
            };

            _context.Add(user);
            _context.Add(userGroupEndUser);
            _context.SaveChanges();
            var token = Utils.GetAccessToken(_client, "user0", "user0"); // スーパー管理者
            var obj   = new
            {
                AuthenticateWhenUnlockingScreen = "string"
            };
            var result = Utils.Put(_client, $"{Url}/" + user.Id, Utils.CreateJsonContent(obj), token);
            var body   = result.Content.ReadAsStringAsync().Result;
            var json   = JObject.Parse(body);

            Assert.Equal(HttpStatusCode.BadRequest, result.StatusCode);
            Assert.NotNull(json["traceId"]);
            Assert.NotNull(json["errors"]?["AuthenticateWhenUnlockingScreen"]);
        }
Ejemplo n.º 5
0
        public ListingMineTests(CustomWebApplicationFactory <JinCreek.Server.Admin.Startup> factory)
        {
            _client  = factory.CreateClient();
            _context = factory.Services.GetService <IServiceScopeFactory>().CreateScope().ServiceProvider.GetService <MainDbContext>();

            Utils.RemoveAllEntities(_context);

            _context.Add(_org1    = Utils.CreateOrganization(code: 1, name: "org1"));
            _context.Add(_org2    = Utils.CreateOrganization(code: 2, name: "org2"));
            _context.Add(_domain1 = new Domain {
                Id = Guid.NewGuid(), Name = "domain01", Organization = _org1
            });
            _context.Add(_domain2 = new Domain {
                Id = Guid.NewGuid(), Name = "domain02", Organization = _org2
            });
            _context.Add(_user1 = new SuperAdmin {
                AccountName = "user0", Password = Utils.HashPassword("user0")
            });                                                                                                      // スーパー管理者
            _context.Add(_user2 = new UserAdmin()
            {
                AccountName = "user1", Password = Utils.HashPassword("user1"), Domain = _domain1
            });                                                                                                                          // ユーザー管理者
            _context.Add(_deviceGroup1 = new DeviceGroup()
            {
                Id = Guid.NewGuid(), Name = "_deviceGroup1", Domain = _domain1
            });
            _context.Add(_lte1 = new LteModule()
            {
                Name = "lte1", UseSoftwareRadioState = true, NwAdapterName = "abc"
            });
            _context.Add(_userGroup1 = new UserGroup {
                Id = Guid.NewGuid(), Domain = _domain1, Name = "userGroup1"
            });
            _context.Add(_userGroupEndUser = new UserGroupEndUser()
            {
                EndUser = _user2, UserGroup = _userGroup1
            });
            _context.Add(_availablePeriod = new AvailablePeriod()
            {
                EndUser = _user2, EndDate = null, StartDate = DateTime.Today
            });
            _context.Add(_simGroup1 = new SimGroup()
            {
                Id                      = Guid.NewGuid(),
                Name                    = "simGroup1",
                Organization            = _org1,
                Apn                     = "apn",
                AuthenticationServerIp  = "AuthServerIpAddress",
                IsolatedNw1IpPool       = "Nw1IpAddressPool",
                IsolatedNw1SecondaryDns = "Nw1SecondaryDns",
                IsolatedNw1IpRange      = "Nw1IpAddressRange",
                IsolatedNw1PrimaryDns   = "Nw1PrimaryDns",
                NasIp                   = "NasIpAddress",
                UserNameSuffix          = "UserNameSuffix",
                PrimaryDns              = "PrimaryDns",
                SecondaryDns            = "SecondaryDns"
            });
            _context.Add(_simGroup2 = new SimGroup
            {
                Id = Guid.NewGuid(), Name = "simGroup2", Organization = _org2, IsolatedNw1IpPool = ""
            });
            _context.Add(_sim1 = new Sim() // 組織 : '自組織
            {
                Msisdn   = "msisdn01",
                Imsi     = "imsi01",
                IccId    = "iccid01",
                UserName = "******",
                Password = "******",
                SimGroup = _simGroup1
            });
            _context.Add(_sim1a = new Sim() // 組織 : '自組織
            {
                Msisdn   = "msisdn01a",
                Imsi     = "imsi01a",
                IccId    = "iccid01a",
                UserName = "******",
                Password = "******",
                SimGroup = _simGroup1
            });
            _context.Add(_sim2 = new Sim() // 組織 : '他組織
            {
                Msisdn   = "msisdn02",
                Imsi     = "imsi02",
                IccId    = "iccid02",
                UserName = "******",
                Password = "******",
                SimGroup = _simGroup2
            });
            _context.Add(_device1 = new Device()
            {
                LteModule     = _lte1,
                Domain        = _domain1,
                Name          = "device01",
                UseTpm        = true,
                ManagedNumber = "001",
                WindowsSignInListCacheDays = 1,
            });
            _context.Add(_device2 = new Device()
            {
                LteModule     = _lte1,
                Domain        = _domain1,
                Name          = "device02",
                UseTpm        = true,
                ManagedNumber = "001",
                WindowsSignInListCacheDays = 1,
            });
            _context.SaveChanges();
        }
Ejemplo n.º 6
0
        public InquiryTests(CustomWebApplicationFactoryWithMariaDb <JinCreek.Server.Admin.Startup> factory)
        {
            _client  = factory.CreateClient();
            _context = factory.Services.GetService <IServiceScopeFactory>().CreateScope().ServiceProvider.GetService <MainDbContext>();

            Utils.RemoveAllEntities(_context);

            _context.Add(_org1    = Utils.CreateOrganization(code: 1, name: "org1"));
            _context.Add(_org2    = Utils.CreateOrganization(code: 2, name: "org2"));
            _context.Add(_domain1 = new Domain {
                Id = Guid.NewGuid(), Name = "domain01", OrganizationCode = _org1.Code
            });
            _context.Add(_domain2 = new Domain {
                Id = Guid.NewGuid(), Name = "domain02", OrganizationCode = _org2.Code
            });
            _context.Add(_userGroup1 = new UserGroup {
                Id = Guid.NewGuid(), Name = "userGroup1", DomainId = _domain1.Id
            });
            _context.Add(_userGroup2 = new UserGroup {
                Id = Guid.NewGuid(), Name = "userGroup2", DomainId = _domain2.Id
            });
            _context.Add(_user0 = new SuperAdmin {
                Name = "", AccountName = "user0", Password = Utils.HashPassword("user0")
            });                                                                                                                 // スーパー管理者
            _context.Add(_user1 = new UserAdmin()
            {
                Name = "", AccountName = "user1", Password = Utils.HashPassword("user1"), Domain = _domain1
            });                                                                                                                                     // ユーザー管理者
            _context.Add(_user2 = new GeneralUser()
            {
                Name = "", AccountName = "user2", DomainId = _domain1.Id
            });
            _context.Add(_user3 = new GeneralUser()
            {
                Name = "", AccountName = "user3", DomainId = _domain1.Id
            });
            _context.Add(_user4 = new GeneralUser()
            {
                Name = "", AccountName = "user4", DomainId = _domain2.Id
            });
            _context.Add(new AvailablePeriod()
            {
                EndUser = _user1, EndDate = DateTime.Parse("2021-03-01"), StartDate = DateTime.Parse("2020-02-10")
            });
            _context.Add(new AvailablePeriod()
            {
                EndUser = _user2, EndDate = DateTime.Parse("2021-03-01"), StartDate = DateTime.Parse("2020-02-10")
            });
            _context.Add(new AvailablePeriod()
            {
                EndUser = _user3, EndDate = DateTime.Parse("2021-03-01"), StartDate = DateTime.Parse("2020-02-10")
            });
            _context.Add(new AvailablePeriod()
            {
                EndUser = _user4, EndDate = DateTime.Parse("2021-03-01"), StartDate = DateTime.Parse("2020-02-10")
            });
            _context.Add(_userGroupEndUser = new UserGroupEndUser()
            {
                EndUser = _user2, UserGroup = _userGroup1
            });
            _context.Add(_simGroup1 = new SimGroup
            {
                Name                    = "simGroup1",
                Organization            = _org1,
                Apn                     = "apn",
                AuthenticationServerIp  = "AuthServerIpAddress",
                IsolatedNw1IpPool       = "Nw1IpAddressPool",
                IsolatedNw1SecondaryDns = "Nw1SecondaryDns",
                IsolatedNw1IpRange      = "Nw1IpAddressRange",
                IsolatedNw1PrimaryDns   = "Nw1PrimaryDns",
                NasIp                   = "NasIpAddress",
                UserNameSuffix          = "UserNameSuffix",
                PrimaryDns              = "PrimaryDns",
                SecondaryDns            = "SecondaryDns"
            });
            _context.Add(_sim1 = new Sim {
                SimGroup = _simGroup1, Msisdn = "msisdn01", Imsi = "imsi01", IccId = "iccid01", UserName = "******", Password = "******"
            });
            _context.Add(_sim2 = new Sim {
                SimGroup = _simGroup1, Msisdn = "msisdn02", Imsi = "imsi02", IccId = "iccid02", UserName = "******", Password = "******"
            });
            _context.Add(_deviceGroup1 = new DeviceGroup {
                DomainId = _domain1.Id, Name = "deviceGroup1"
            });
            _context.Add(_device1 = new Device
            {
                LteModule     = _lte1,
                Domain        = _domain1,
                Name          = "device01",
                UseTpm        = true,
                ManagedNumber = "001",
                ProductName   = "",
                SerialNumber  = "",
                WindowsSignInListCacheDays = 1,
                StartDate = DateTime.Parse("2020-02-07"),
                EndDate   = DateTime.Parse("2021-02-01")
            });
            _context.Add(_device2 = new Device
            {
                LteModule     = _lte1,
                Domain        = _domain1,
                Name          = "device02",
                UseTpm        = true,
                ManagedNumber = "002",
                ProductName   = "",
                SerialNumber  = "",
                WindowsSignInListCacheDays = 1,
                StartDate = DateTime.Parse("2020-02-07"),
                EndDate   = DateTime.Parse("2021-02-01")
            });
            _context.Add(_device3 = new Device
            {
                LteModule     = _lte1,
                Domain        = _domain2,
                Name          = "device02",
                UseTpm        = true,
                ManagedNumber = "002",
                ProductName   = "",
                SerialNumber  = "",
                WindowsSignInListCacheDays = 1,
                StartDate = DateTime.Parse("2020-02-07"),
                EndDate   = DateTime.Parse("2021-02-01")
            });
            _context.Add(_simDevice1 = new SimAndDevice
            {
                SimId                  = _sim1.Id,
                DeviceId               = _device1.Id,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Parse("2020-03-07"),
            });
            _context.Add(_simDevice2 = new SimAndDevice
            {
                SimId                  = _sim2.Id,
                DeviceId               = _device1.Id,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Parse("2020-03-07"),
            });
            _context.Add(_simDevice3 = new SimAndDevice
            {
                SimId                  = _sim1.Id,
                DeviceId               = _device2.Id,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Parse("2020-03-07"),
            });
            _context.Add(_simDevice4 = new SimAndDevice
            {
                SimId                  = _sim2.Id,
                DeviceId               = _device2.Id,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Parse("2020-03-07"),
            });
            _context.Add(_multiFactor1 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice1.Id,
                EndUserId      = _user2.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor2 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice2.Id,
                EndUserId      = _user2.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor3 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice3.Id,
                EndUserId      = _user2.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor4 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice4.Id,
                EndUserId      = _user2.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor5 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice1.Id,
                EndUserId      = _user3.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor6 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice2.Id,
                EndUserId      = _user3.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor7 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice3.Id,
                EndUserId      = _user3.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor8 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice4.Id,
                EndUserId      = _user3.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor9 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice1.Id,
                EndUserId      = _user4.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor10 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice2.Id,
                EndUserId      = _user4.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor11 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice3.Id,
                EndUserId      = _user4.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(_multiFactor12 = new MultiFactor
            {
                Id             = Guid.NewGuid(),
                SimAndDeviceId = _simDevice4.Id,
                EndUserId      = _user4.Id,
                ClosedNwIp     = "127.0.0.1",
                StartDate      = DateTime.Parse("2020-02-01"),
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor1
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor2
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor3
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor4
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor5
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor6
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor7
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor8
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor9
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor10
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor11
            });
            _context.Add(new MultiFactorAuthenticated()
            {
                Expiration = DateTime.Now.AddHours(1.00), MultiFactor = _multiFactor12
            });
            _context.SaveChanges();
        }
Ejemplo n.º 7
0
        public CsvExportMineTests(CustomWebApplicationFactory <JinCreek.Server.Admin.Startup> factory)
        {
            _client  = factory.CreateClient();
            _context = factory.Services.GetService <IServiceScopeFactory>().CreateScope().ServiceProvider.GetService <MainDbContext>();

            Utils.RemoveAllEntities(_context);

            _context.Add(_org1    = Utils.CreateOrganization(code: 1, name: "org1"));
            _context.Add(_org2    = Utils.CreateOrganization(code: 2, name: "org2"));
            _context.Add(_domain1 = new Domain {
                Id = Guid.NewGuid(), Name = "domain01", Organization = _org1
            });
            _context.Add(_domain2 = new Domain {
                Id = Guid.NewGuid(), Name = "domain03", Organization = _org2
            });
            _context.Add(_userGroup1 = new UserGroup {
                Id = Guid.NewGuid(), Name = "userGroup1", Domain = _domain1
            });
            _context.Add(_userGroup2 = new UserGroup {
                Id = Guid.NewGuid(), Name = "userGroup2", Domain = _domain2
            });
            _context.Add(_user1 = new SuperAdmin {
                AccountName = "user0", Password = Utils.HashPassword("user0")
            });                                                                                                      // スーパー管理者
            _context.Add(_user2 = new UserAdmin {
                AccountName = "user1", Password = Utils.HashPassword("user1"), Domain = _domain1
            });                                                                                                                        // ユーザー管理者
            _context.Add(_userGroupEndUser = new UserGroupEndUser()
            {
                EndUser = _user2, UserGroup = _userGroup1
            });
            _context.Add(_availablePeriod = new AvailablePeriod()
            {
                EndUser = _user2, EndDate = null, StartDate = DateTime.Today
            });
            _context.Add(_simGroup1 = new SimGroup()
            {
                Id                      = Guid.NewGuid(),
                Name                    = "simGroup1",
                Organization            = _org1,
                Apn                     = "apn",
                AuthenticationServerIp  = "AuthenticationServerIp",
                IsolatedNw1IpPool       = "IsolatedNw1IpPool",
                IsolatedNw1SecondaryDns = "IsolatedNw1SecondaryDns",
                IsolatedNw1IpRange      = "IsolatedNw1IpRange",
                IsolatedNw1PrimaryDns   = "IsolatedNw1PrimaryDns",
                NasIp                   = "NasIp",
                PrimaryDns              = "PrimaryDns",
                SecondaryDns            = "SecondaryDns"
            });
            _context.Add(_simGroup2 = new SimGroup()
            {
                Id                      = Guid.NewGuid(),
                Name                    = "simGroup2",
                Organization            = _org2,
                Apn                     = "apn",
                AuthenticationServerIp  = "AuthenticationServerIp",
                IsolatedNw1IpPool       = "IsolatedNw1IpPool",
                IsolatedNw1SecondaryDns = "IsolatedNw1SecondaryDns",
                IsolatedNw1IpRange      = "IsolatedNw1IpRange",
                IsolatedNw1PrimaryDns   = "IsolatedNw1PrimaryDns",
                NasIp                   = "NasIp",
                PrimaryDns              = "PrimaryDns",
                SecondaryDns            = "SecondaryDns"
            });
            _context.Add(_sim1 = new Sim() // 組織 : '自組織
            {
                Msisdn   = "msisdn01",
                Imsi     = "imsi01",
                IccId    = "iccid01",
                UserName = "******",
                Password = "******",
                SimGroup = _simGroup1
            });
            _context.Add(_sim2 = new Sim() // 組織 : '自組織
            {
                Msisdn   = "msisdn02",
                Imsi     = "imsi02",
                IccId    = "iccid02",
                UserName = "******",
                Password = "******",
                SimGroup = _simGroup1
            });
            _context.Add(_sim3 = new Sim() // 組織 : '他組織
            {
                Msisdn   = "msisdn03",
                Imsi     = "imsi03",
                IccId    = "iccid03",
                UserName = "******",
                Password = "******",
                SimGroup = _simGroup2
            });
            _context.Add(_device1 = new Device()
            {
                LteModule     = null,
                Domain        = _domain1,
                Name          = "device01",
                UseTpm        = true,
                ManagedNumber = "001",
                WindowsSignInListCacheDays = 1,
            });
            _context.Add(_device2 = new Device()
            {
                LteModule     = null,
                Domain        = _domain1,
                Name          = "device02",
                UseTpm        = true,
                ManagedNumber = "001",
                WindowsSignInListCacheDays = 1,
            });
            _context.Add(_simDevice1 = new SimAndDevice()  // 組織 : '自組織
            {
                Sim                    = _sim1,
                Device                 = _device1,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Now.AddHours(6.00)
            });
            _context.Add(_simDevice2 = new SimAndDevice() // 組織 : '自組織
            {
                Sim                    = _sim2,
                Device                 = _device1,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Now.AddHours(6.00)
            });
            _context.Add(_simDevice3 = new SimAndDevice() // 組織 : '自組織
            {
                Sim                    = _sim2,
                Device                 = _device2,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Now.AddHours(6.00)
            });
            _context.Add(_simDevice4 = new SimAndDevice() // 組織 : '他組織
            {
                Sim                    = _sim3,
                Device                 = _device2,
                IsolatedNw2Ip          = "127.0.0.1",
                AuthenticationDuration = 1,
                StartDate              = DateTime.Parse("2020-02-07"),
                EndDate                = DateTime.Now.AddHours(6.00)
            });
            _context.SaveChanges();
        }