예제 #1
0
        public void GetInitiativeProvider_Success()
        {
            // Arrange
            var requestBuilder = new Initiative.InitiativeBuilder().SbcaVolenteering();
            var mokAdapter     = new Initiative.AdapterBuilder().AddGetStub(requestBuilder.Build()).Build();
            var provider       = new InitiativeProvider(mokAdapter);

            // Act
            var response = provider.Get(requestBuilder.Id);
            var expected = requestBuilder.UpdateId(response.Id).Build();

            // Assert
            Assert.IsNotNull(response);
            var compareDetails = Comparer.Compare(expected, response);

            compareDetails.DisplayDifferences();
            Assert.IsTrue(compareDetails.AreEqual, "The initative comparison failed");
        }
예제 #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));
        }