예제 #1
0
        public void AcceptanceCreateBacklogTest()
        {
            IBacklogRepo repo       = new BacklogRepoTest();
            ITotalOrder  totalOrder = new TotalOrder();

            RequestHandler requestHandler = new RequestHandler(repo, totalOrder, _userRepo.Object, null, null);

            BacklogCreationRequest backlogCreationRequest = new BacklogCreationRequest
            {
                Title       = "The backlog",
                UserStories = new string[] { "A", "B", "C" },
                UserId      = 123
            };

            var(status, result) = requestHandler.HandleBacklogCreationRequest(backlogCreationRequest);
            status.Should().BeOfType(typeof(Success));

            // expected result
            BacklogEvalQueryResult expectedResult = new BacklogEvalQueryResult
            {
                Id = "7",
                NumberOfSubmissions = 1,
                Title       = "The backlog",
                UserStories = new string[] { "A", "B", "C" }
            };

            result.Should().BeEquivalentTo(expectedResult);
        }
예제 #2
0
        public void HandleGetBacklogsSuccessfulTest()
        {
            IBacklogRepo repo       = new BacklogRepoTest();
            ITotalOrder  totalOrder = new TotalOrder();

            RequestHandler requestHandler = new RequestHandler(repo, totalOrder, null, null, null);

            var result = (Success <BacklogShowQueryResult>)requestHandler.HandleBacklogsShowRequest();

            Assert.That(result.Data.Backlogs.Count == 2);
            foreach (var backlog in result.Data.Backlogs)
            {
                Assert.That(backlog.UserStoryCount == 3);
                Assert.That(backlog.VoteCount == 1);
            }
        }