public void UpdateHitsTest() { try { DbLocation dbLocation = new DbLocation(); Location location = new Location { User = new User { UserId = 1 }, Latitude = 1, Longitude = 1, LocationDescription = "Test description", LocationName = "UpdateHitsTest", Hits = 0 }; int id = dbLocation.Create(location); location.LocationId = id; dbLocation.UpdateHits(location); Location newLocation = dbLocation.FindById(id); Assert.IsTrue(location.Hits < newLocation.Hits); dbLocation.Delete(location.LocationId); } catch (FaultException <System.Exception> ) { Assert.Fail(); } }
/// <summary> /// Updates amount of hits /// </summary> /// <param name="location"></param> public void UpdateHits(Location location) { _dbLocation.UpdateHits(location); }