public void TestCreateModelIsNewLocation() { var result = _controller.Create() as ViewResult; var model = result.ViewData.Model as Location; var expected = new Location(); Assert.IsTrue(LocationsAreEquivalent(expected, model), "Model should be a new Location"); }
public void DeleteLocation(Location location) { _locations.Remove(location); }
public void AddLocation(Location location) { location.id = ++_locationMaxId; _locations.Add(location); }
public void AddLocation(Location location) { _conferenceware.Locations.InsertOnSubmit(location); }
public void DeleteLocation(Location location) { _conferenceware.Locations.DeleteOnSubmit(location); }
partial void DeleteLocation(Location instance);
partial void UpdateLocation(Location instance);
partial void InsertLocation(Location instance);
private void InitRepoAndTwoLocations() { _location1 = new Location { building_name = "Siebel Center", room_number = "1404", max_capacity = 175, notes = "Large lecture hall in Siebel" }; _location2 = new Location { building_name = "Digital Computer Laboratory", room_number = "1320", max_capacity = 200, notes = "Power avaiable to people in the room" }; _location3 = new Location { building_name = "Building", room_number = "Room", max_capacity = 10, notes = "Notes" }; _repository = new TestRepository(); _repository.AddLocation(_location1); _repository.AddLocation(_location2); _repository.Save(); }
private FormCollection ConvertLocationToFormCollection(Location loc) { var fc = new FormCollection(); fc.Add("id", loc.id.ToString()); fc.Add("building_name", loc.building_name); fc.Add("room_number", loc.room_number); fc.Add("max_capacity", loc.max_capacity.ToString()); fc.Add("notes", loc.notes); return fc; }
/// <summary> /// Checks if two locations are equivalent for data (less id) /// </summary> /// <param name="loc1">The first location to check</param> /// <param name="loc2">The second location to check</param> /// <returns>Whether or not the locations are equivalent</returns> private static bool LocationsAreEquivalent(Location loc1, Location loc2) { return loc1.building_name == loc2.building_name && loc1.room_number == loc2.room_number && loc1.max_capacity == loc2.max_capacity && loc1.notes == loc2.notes; }