Пример #1
0
        public void PutTest()
        {
            // Arrange
            EventDetailRepository eventDetailRepository = new EventDetailRepository();
            EventDetailController controller            = new EventDetailController(eventDetailRepository);
            EventDetail           eventDetail           = new EventDetail()
            {
                EventID             = 1,
                EventDetailStatusID = 1,
                EventDetailName     = "Update Event Detail API Unit Test",
                EventDetailNumber   = 1,
                EventDetailsOdd     = 1,
                FinishingPosition   = 1,
                FirstTimer          = true,
            };

            // Act
            int EventDetailID = controller.Create(eventDetail);

            eventDetail.EventDetailID   = EventDetailID;
            eventDetail.EventDetailName = "Updated Event Detail API Unit Test";
            bool isUpdated = controller.Update(eventDetail);

            // Assert
            Assert.IsTrue(isUpdated);
        }
Пример #2
0
        public void PostTest()
        {
            // Arrange
            EventDetailRepository eventDetailRepository = new EventDetailRepository();
            EventDetailController controller            = new EventDetailController(eventDetailRepository);
            EventDetail           eventDetail           = new EventDetail()
            {
                EventID             = 1,
                EventDetailStatusID = 1,
                EventDetailName     = "Create Event Detail Unit Test",
                EventDetailNumber   = 1,
                EventDetailsOdd     = 1,
                FinishingPosition   = 1,
                FirstTimer          = true,
            };

            // Act
            int EventDetailID = controller.Create(eventDetail);

            // Assert
            Assert.AreNotEqual(EventDetailID, 0);
        }