Example #1
0
        public async Task OrganizationsThatDoNotMatchOrganizationIdOnCommand_ReturnsNull()
        {
            var query = new OrganizationDetailQueryAsync {
                Id = 999
            };
            var handler = new OrganizationDetailQueryHandlerAsync(Context);
            var result  = await handler.Handle(query);

            Assert.Null(result);
        }
Example #2
0
        public async Task OrganizationThatMatchesOrganizationIdOnCommand_ReturnsCampaignDetails()
        {
            var query = new OrganizationDetailQueryAsync {
                Id = 1
            };
            var handler = new OrganizationDetailQueryHandlerAsync(Context);
            var result  = await handler.Handle(query);

            Assert.Equal(1, result.Campaigns.Count);
            Assert.Equal("Campaign 1", result.Campaigns[0].Name);
        }
Example #3
0
        public async Task OrganizationThatMatchesOrganizationIdOnCommand_ReturnsContactDetails()
        {
            var query = new OrganizationDetailQueryAsync {
                Id = 1
            };
            var handler = new OrganizationDetailQueryHandlerAsync(Context);
            var result  = await handler.Handle(query);

            Assert.Equal("*****@*****.**", result.PrimaryContactEmail);
            Assert.Equal("firstName", result.PrimaryContactFirstName);
            Assert.Equal("lastName", result.PrimaryContactLastName);
            Assert.Equal("123", result.PrimaryContactPhoneNumber);
        }
Example #4
0
        public async Task OrganizationThatMatchesOrganizationIdOnCommand_ReturnsOrganizationDetails()
        {
            var query = new OrganizationDetailQueryAsync {
                Id = 1
            };
            var handler = new OrganizationDetailQueryHandlerAsync(Context);
            var result  = await handler.Handle(query);

            Assert.Equal(1, result.Id);
            Assert.Equal("http://www.org1.org", result.WebUrl);
            Assert.Equal("http://www.org1Logo.org", result.LogoUrl);
            Assert.Equal("Org 1", result.Name);
            Assert.NotNull(result.Location);
            Assert.Equal(1, result.Location.Id);
            Assert.Equal("USA", result.Location.Country);
        }