Esempio n. 1
0
        public ActionResult Custodians(Guid id)
        {
            var community = _communitiesQuery.GetCommunity(id);

            if (community == null)
            {
                return(NotFound("community", "id", id));
            }

            return(View(new CustodiansModel
            {
                Community = community,
                Custodians = _custodiansQuery.GetAffiliationCustodians(community.Id)
            }));
        }
Esempio n. 2
0
        private void AssertSavedLogins(Community community, ICollection <Custodian> expectedCustodians)
        {
            var custodians = _custodiansQuery.GetAffiliationCustodians(community.Id);

            Assert.AreEqual(expectedCustodians.Count, custodians.Count);

            foreach (var expectedCustodian in expectedCustodians)
            {
                var id        = _loginCredentialsQuery.GetUserId(expectedCustodian.GetLoginId());
                var custodian = _custodiansQuery.GetCustodian(id.Value);
                Assert.IsNotNull(custodian);

                // Check one of the recrutiers for the organisation.

                Assert.AreEqual(true, (from r in custodians where r.Id == custodian.Id select r).Any());

                // Check one of the recrutiers for the community.

                Assert.AreEqual(expectedCustodian.EmailAddress, custodian.EmailAddress);
                Assert.AreEqual(expectedCustodian.FirstName, custodian.FirstName);
                Assert.AreEqual(expectedCustodian.LastName, custodian.LastName);
                Assert.AreEqual(expectedCustodian.GetLoginId(), custodian.GetLoginId());
            }
        }