コード例 #1
0
        public void Test4_AssignedIDTOObjects()
        {
            //Arrange, Act
              Restaurant testRestaurant = new Restaurant("Burger King", "Seattle", 1);
              //Act
              testRestaurant.Save();
              Restaurant saveRestaurant = Restaurant.GetAll()[0];

              int result = saveRestaurant.GetId();
              int testId = testRestaurant.GetId();

              //Assert
              Assert.Equal(testId, result);
        }
コード例 #2
0
 public void Test5_Find_FindsRestaurantInDatabase()
 {
     //Arrange
       Restaurant testRestaurant = new Restaurant("Burger King", "Seattle", 2);
       testRestaurant.Save();
       //Act
       Restaurant foundRestaurant = Restaurant.Find(testRestaurant.GetId());
       //Assert
       Assert.Equal(testRestaurant, foundRestaurant);
 }