示例#1
0
 protected override void Cleanup()
 {
     using (DMSTestDataContext testDataContext = new DMSTestDataContext())
     {
         testDataContext.Location_MasterDtos.DeleteAllOnSubmit(
             testDataContext.Location_MasterDtos.Where(c => c.LocationId == _locationId1 ||
                                                       c.LocationId == _locationId2 ||
                                                       c.LocationId == _locationId3));
         testDataContext.SubmitChanges();
     }
 }
示例#2
0
        protected override void BecauseOf()
        {
            using (DMSTestDataContext testDataContext = new DMSTestDataContext())
            {
                List <Location_MasterDto> locationMasterDtos = new List <Location_MasterDto>();
                locationMasterDtos.Add(new Location_MasterDto
                {
                    IsAVAvailable        = true,
                    IsPhoneAvailable     = true,
                    IsVideoConfAvailable = true,
                    LocationBuilding     = "Building1",
                    LocationCapacity     = 10,
                    LocationFloor        = "1",
                    LocationId           = _locationId1,
                    LocationName         = "Test 1",
                    LocationRoom         = "TestRoom"
                });
                locationMasterDtos.Add(new Location_MasterDto
                {
                    IsAVAvailable        = true,
                    IsPhoneAvailable     = true,
                    IsVideoConfAvailable = true,
                    LocationBuilding     = "Building2",
                    LocationCapacity     = 10,
                    LocationFloor        = "1",
                    LocationId           = _locationId2,
                    LocationName         = "Test 2",
                    LocationRoom         = "TestRoom"
                });
                locationMasterDtos.Add(new Location_MasterDto
                {
                    IsAVAvailable        = true,
                    IsPhoneAvailable     = true,
                    IsVideoConfAvailable = true,
                    LocationBuilding     = "Building3",
                    LocationCapacity     = 10,
                    LocationFloor        = "1",
                    LocationId           = _locationId3,
                    LocationName         = "Test 3",
                    LocationRoom         = "TestRoom"
                });

                testDataContext.Location_MasterDtos.InsertAllOnSubmit(locationMasterDtos);
                testDataContext.SubmitChanges();

                _locationId1 = locationMasterDtos.ElementAt(0).LocationId;
                _locationId2 = locationMasterDtos.ElementAt(1).LocationId;
                _locationId3 = locationMasterDtos.ElementAt(2).LocationId;
            }
        }
示例#3
0
        protected override void BecauseOf()
        {
            using (DMSTestDataContext testDataContext = new DMSTestDataContext())
            {
                List <UserDto> userDtos = new List <UserDto>();
                userDtos.Add(new UserDto
                {
                    Password             = "******",
                    PasswordActiveDate   = DateTime.Today,
                    RequirePasswordReset = false,
                    UserEmail            = "*****@*****.**",
                    UserFirstName        = "FirstUserFN",
                    UserId       = _userId1,
                    UserLastName = "FirstUserLN",
                    UserName     = "******"
                });
                userDtos.Add(new UserDto
                {
                    Password             = "******",
                    PasswordActiveDate   = DateTime.Today,
                    RequirePasswordReset = false,
                    UserEmail            = "*****@*****.**",
                    UserFirstName        = "SecondUserFN",
                    UserId       = _userId2,
                    UserLastName = "SecondUserLN",
                    UserName     = "******"
                });
                userDtos.Add(new UserDto
                {
                    Password             = "******",
                    PasswordActiveDate   = DateTime.Today,
                    RequirePasswordReset = false,
                    UserEmail            = "*****@*****.**",
                    UserFirstName        = "ThirdUserFN",
                    UserId       = _userId3,
                    UserLastName = "ThirdUserLN",
                    UserName     = "******"
                });

                testDataContext.UserDtos.InsertAllOnSubmit(userDtos);
                testDataContext.SubmitChanges();

                _userId1 = userDtos.ElementAt(0).UserId;
                _userId2 = userDtos.ElementAt(1).UserId;
                _userId3 = userDtos.ElementAt(2).UserId;
            }
        }