Пример #1
0
        public void PutShouldUpdateTheater_Pass()
        {
            // Arrange
            var dbcontext      = new BroadwayBuilderContext();
            var theaterService = new TheaterService(dbcontext);
            var theater        = new Theater("TEST", "Theater controller", "PUT", "UpdateTheater", "CA", "US", "1355");

            theaterService.CreateTheater(theater);
            dbcontext.SaveChanges();
            var theaterController = new TheaterController();

            // Act
            theater.State       = "CHANGED DATA";
            theater.City        = "CHANGED DATA";
            theater.PhoneNumber = "CHanged DATA";
            var actionResult = theaterController.UpdateTheater(theater);
            var response     = actionResult as NegotiatedContentResult <Theater>;
            var content      = response.Content;

            theaterService.DeleteTheater(theater);
            dbcontext.SaveChanges();
            // Assert
            Assert.IsNotNull(response);
            Assert.IsNotNull(content);
            Assert.AreEqual((HttpStatusCode)200, response.StatusCode);
        }
Пример #2
0
        private void BtnUpdate_Click(object sender, EventArgs e)
        {
            _dto.TheaterName = txtTheaterName.Text;
            bool result = _tc.UpdateTheater(_dto);

            if (result)
            {
                MessageBox.Show("Salon başarıyla güncellendi");
            }
        }