public void BecauseOf() { using (TestDataContext dataContext = new TestDataContext(_connectionString)) { UserDto userDto = new UserDto { DisplayName = "TestUserName", Id = _idToUse, Latitude = 1.0M, Longitude = 1.0M, Email = "*****@*****.**", ZoneId = _currentHotZone, Money = 500, Level = 1, BaseLineEnergy = 15, BaseLineAttackPower = 15, PossibleItemAmount = 5 }; dataContext.UserDtos.InsertOnSubmit(userDto); dataContext.SubmitChanges(); HotZoneDto hotZoneDto = new HotZoneDto { CanStartHere = false, Id = _newHotZoneIdToUse, Latitude = (decimal)_newHotZoneLatitude, Longitude = (decimal)_newHotZoneLongitude, Name = "New Test HotZone" }; dataContext.HotZoneDtos.InsertOnSubmit(hotZoneDto); dataContext.SubmitChanges(); } }
public void TestInitialize() { TestDataContext dataContext = new TestDataContext(DalTestContextSpecification.ConnectionString); UserDto userDto = new UserDto { Id = _userId, DisplayName = "name", Email = "email", Latitude = 0, LocationId = Guid.NewGuid(), Longitude = 0, ZoneId = Guid.NewGuid() }; dataContext.UserDtos.InsertOnSubmit(userDto); dataContext.SubmitChanges(); }
public void TestInitialize() { TestDataContext testDataContext = new TestDataContext(_connectionString); var userCountDto = new UserCountDto { Id = Guid.NewGuid(), HotZonesDestroyed = 10, Miles = 11, UserId = _userId, PeakAttack = 111, ZombiesKilled = 1111, ZombiePacksDestroyed = 11111, AccumulatedMoney = 500 }; testDataContext.UserCountDtos.InsertOnSubmit(userCountDto); testDataContext.SubmitChanges(); UserDto userDto = new UserDto { Id = _userId, DisplayName = "name", Email = string.Empty }; testDataContext.UserDtos.InsertOnSubmit(userDto); testDataContext.SubmitChanges(); }
public void TestInitialize() { TestDataContext dataContext = new TestDataContext(DalTestContextSpecification.ConnectionString); UserDto userDto = new UserDto { Id = _populatedUserId, DisplayName = "name", Email = "email", LastEnergy = 50, LastEnergyDate = DateTime.Today, Latitude = 0, LocationId = Guid.NewGuid(), Longitude = 0, BaseLineEnergy = 100, ZoneId = Guid.NewGuid() }; dataContext.UserDtos.InsertOnSubmit(userDto); userDto = new UserDto { Id = _emptyUserId, DisplayName = "name", Email = "email", LastEnergy = null, LastEnergyDate = null, Latitude = 0, LocationId = Guid.NewGuid(), Longitude = 0, BaseLineEnergy = 0, ZoneId = Guid.NewGuid() }; dataContext.UserDtos.InsertOnSubmit(userDto); dataContext.SubmitChanges(); }
private void GivenUser(int withFacebookId, int level, string name, long killed = 0, long miles = 0, long packs = 0, long hotzones = 0, long money = 0, long streak = 0) { TestDataContext testDataContext = new TestDataContext(DalTestContextSpecification.ConnectionString); Guid userId = Guid.NewGuid(); UserDto userDto = new UserDto { Id = userId, BaseLineAttackPower = 0, BaseLineEnergy = 0, CurrentBaseAttack = 0, CurrentBaseEnergy = 0, DisplayName = name, Email = string.Empty, FacebookUserId = withFacebookId, Latitude = 0, Level = level, ZoneId = Guid.Empty }; testDataContext.UserDtos.InsertOnSubmit(userDto); testDataContext.SubmitChanges(); UserCountDto userCountDto = new UserCountDto { AccumulatedMoney = money, HotZonesDestroyed = hotzones, Id = Guid.NewGuid(), Miles = miles, PeakAttack = streak, UserId = userId, ZombiePacksDestroyed = packs, ZombiesKilled = killed }; testDataContext.UserCountDtos.InsertOnSubmit(userCountDto); testDataContext.SubmitChanges(); _userIds.Add(userId); }
private Guid GivenUser(string name) { TestDataContext testDataContext = new TestDataContext(DalTestContextSpecification.ConnectionString); Guid userId = Guid.NewGuid(); UserDto userDto = new UserDto { Id = userId, BaseLineAttackPower = 0, BaseLineEnergy = 0, CurrentBaseAttack = 0, CurrentBaseEnergy = 0, DisplayName = name, Email = string.Empty, FacebookUserId = 0, Latitude = 0, Level = 0, ZoneId = Guid.Empty }; testDataContext.UserDtos.InsertOnSubmit(userDto); testDataContext.SubmitChanges(); _userIds.Add(userId); return userId; }
partial void DeleteUserDto(UserDto instance);
partial void UpdateUserDto(UserDto instance);
partial void InsertUserDto(UserDto instance);
private void GivenUserWithFacebookId(long facebookUserId) { TestDataContext testDataContext = new TestDataContext(DalTestContextSpecification.ConnectionString); testDataContext = new TestDataContext(DalTestContextSpecification.ConnectionString); UserDto userDto = new UserDto { BaseLineAttackPower = 0, BaseLineEnergy = 0, PossibleItemAmount = 0, CurrentBaseAttack = 0, CurrentBaseEnergy = 0, DisplayName = string.Empty, Email = string.Empty, FacebookUserId = facebookUserId, Id = Guid.NewGuid(), Latitude = 0, ZoneId = Guid.Empty }; testDataContext.UserDtos.InsertOnSubmit(userDto); testDataContext.SubmitChanges(); }