Example #1
0
 public void InsertsDestination(Destination destination)
 {
     using (var context = new BreakAwayContext())
     {
         context.Destinations.Add(destination);
         context.SaveChanges();
     }
 }
Example #2
0
 public void InsertDestination_WhenClerkInsertsADestination_ShouldBeStoredInTheDatabase()
 {
     // Arrange
      var destination = new Destination
                            {
                                Country = "Indonesia",
                                Description = "EcoTourism at its best in exquisite Bali",
                                Name = "Bali"
                            };
      var theClerk = new Clerk();
      // Act
      theClerk.InsertsDestination(destination);
      // Assert
      Destination actualDestination = null;
      using (var context = new BreakAwayContext())
      {
          actualDestination = context.Destinations.Where(x => x.Country == "Indonesia").FirstOrDefault();
      }
      Assert.AreEqual(expected: destination, actual: actualDestination);
 }
Example #3
0
 public bool Equals(Destination other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.DestinationId == DestinationId && Equals(other.Name, Name) && Equals(other.Country, Country) && Equals(other.Description, Description) && Equals(other.Photo, Photo) && Equals(other.Lodgings, Lodgings);
 }