Example #1
0
        public void RegisterTaskHasHasProducesAtttributeWithTheCorrectContentType()
        {
            var sut       = new TaskApiController(null, null, null);
            var attribute = sut.GetAttributesOn(x => x.RegisterTask(It.IsAny <VolunteerTaskSignupViewModel>())).OfType <ProducesAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal("application/json", attribute.ContentTypes.Select(x => x).First());
        }
Example #2
0
        public void RegisterTaskHasHttpPostAttributeWithCorrectTemplate()
        {
            var sut       = new TaskApiController(null, null, null);
            var attribute = sut.GetAttributesOn(x => x.RegisterTask(It.IsAny <VolunteerTaskSignupViewModel>())).OfType <HttpPostAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal("signup", attribute.Template);
        }
Example #3
0
        public void PutHasHttpPutAttributeWithCorrectTemplate()
        {
            var sut       = new TaskApiController(null, null, null);
            var attribute = sut.GetAttributesOn(x => x.Put(It.IsAny <int>(), It.IsAny <VolunteerTaskViewModel>())).OfType <HttpPutAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal("{id}", attribute.Template);
        }
Example #4
0
        public void DeleteHasHttpDeleteAttributeWithCorrectTemplate()
        {
            var sut       = new TaskApiController(null, null, null);
            var attribute = sut.GetAttributesOn(x => x.Delete(It.IsAny <int>())).OfType <HttpDeleteAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal("{id}", attribute.Template);
        }
        public void ChangeStatusHasRouteAttributeWithCorrectTemplate()
        {
            var sut       = new TaskApiController(null, null, null);
            var attribute = sut.GetAttributesOn(x => x.ChangeStatus(It.IsAny <VolunteerTaskChangeModel>())).OfType <RouteAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal(attribute.Template, "changestatus");
        }