public void BookingCalculationTest() { //Arrange ShowController sw = new ShowController(); Booking b = new Booking() { NoOfSeats = 5, BookingId = 10, DateOfBooking = Convert.ToDateTime("2/18/2019"), Email = "*****@*****.**", PaymentId = 1, ShowId = 43, TimeOfBooking = DateTime.Now, TotalAmount = 0 }; Show s = new Show() { MovieId = 14, Rate = 200, ScreenId = 6, ShowId = 43, Time = TimeSpan.Parse("22:00:00") }; BookingViewModel bvm = new BookingViewModel() { booking = b, show = s }; //bvm.booking.NoOfSeats = 4; //bvm.show.Rate = 190; int expected = 1000; sw.BookingCalculation(bvm); var actual = bvm.booking.TotalAmount; //Act Assert.AreEqual(expected, actual); }