Beispiel #1
0
        public void GET_GoodData_OkResult()
        {
            var request = _eventType.Get() as OkObjectResult;
            var result = (List<EventType>)request.Value;

            result.Count.Should().BeGreaterThan(0);
        }
        public void RESTEventTypeGetByWrongId()
        {
            var controller = new EventTypeController(_eventTypeRepository, false);

            var data = controller.Get(40).Result;

            Assert.IsTrue(data is NotFoundResult);
        }
Beispiel #3
0
        public void EventTypeControllerGetByIdTest()
        {
            // Arrange
            controller = new EventTypeController(_eventTypeRepository);

            // Act
            var result = controller.Get(1) as ObjectResult;

            // Assert
            Assert.AreEqual(1, ((EventTypeDto)result.Value).Id);
        }
Beispiel #4
0
        public void EventTypeControllerGetAllTest()
        {
            // Arrange
            controller = new EventTypeController(_eventTypeRepository);

            // Act
            var result = controller.Get();

            // Assert
            Assert.AreEqual(2, result.Count());
        }
        public void RESTEventTypeGetById()
        {
            var controller = new EventTypeController(_eventTypeRepository, false);

            var result   = controller.Get(1).Result;
            var okResult = result as OkObjectResult;
            var data     = okResult.Value as event_type;

            Assert.IsNotNull(data);
            Assert.AreEqual(1, data.id);
            Assert.AreEqual("plague", data.name);
        }
        public void RESTEventTypeGetAllValues()
        {
            var controller = new EventTypeController(_eventTypeRepository, false);

            var result   = controller.Get().Result;
            var okResult = result as OkObjectResult;
            var data     = okResult.Value as IEnumerable <event_type>;

            Assert.IsNotNull(data);

            var test = data.ToList();

            Assert.AreEqual(3, test.Count);
        }