public void cannot_add_duplicate_places() { var p = new Place { Id = 1 }; var l = new List(); l.AddPlace(p); l.AddPlace(p); Assert.AreEqual(1, l.Places.Count); }
public void can_add_new_place() { var p = new Place {Id = 1}; var l = new List(); l.AddPlace(p); Assert.AreEqual(1, l.Places.Count); }
// GET /api/values public User Get() { var user = DocumentSession.Load<User>(2); var list = new List(); list.User = "******"; var p = new Place { Description = "Kinda trendy place - multiple rooms, decent beer from Leeds brewary and guests", Latitude = 52.002324f, Longitude = -0.5734f, Name = "The Adelphi" }; DocumentSession.Store(p); DocumentSession.SaveChanges(); list.AddPlace(p); DocumentSession.Store(list); DocumentSession.SaveChanges(); return user; }