Exemplo n.º 1
0
        public void GetAllChallengesForInitiativeProvider_Success()
        {
            // Arrange
            var mokAdapter = new Initiative.AdapterBuilder().AddGetAllChallengesStub().Build();
            var provider   = new InitiativeProvider(mokAdapter);

            // Act
            var response = provider.GetAllChallenges(Guid.NewGuid());

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Count() == 2, "Did not return expected 2 challenges");
        }
Exemplo n.º 2
0
        public ActionResult Initiative(Guid initiativeId)
        {
            var provider = new InitiativeProvider();

            var intiative  = provider.Get(initiativeId);
            var challenges = provider.GetAllChallenges(initiativeId);

            if (intiative == null)
            {
                return(View(new InitiativeModel()));
            }

            var model = new InitiativeModel
            {
                Id          = intiative.Id,
                Title       = intiative.Title,
                Description = intiative.Description,
                Challenges  = challenges
            };

            return(View(model));
        }