Ejemplo n.º 1
0
        public async Task TestOrganizationTypeEC_GetNewOrganizationTypeEC()
        {
            var categoryOfOrganizationToLoad = BuildOrganizationType();
            var categoryOfOrganization       = await OrganizationTypeEC.GetOrganizationTypeEC(categoryOfOrganizationToLoad);

            Assert.NotNull(categoryOfOrganization);
            Assert.IsType <OrganizationTypeEC>(categoryOfOrganization);
            Assert.Equal(categoryOfOrganizationToLoad.Id, categoryOfOrganization.Id);
            Assert.Equal(categoryOfOrganizationToLoad.Name, categoryOfOrganization.Name);
            Assert.Equal(categoryOfOrganizationToLoad.Notes, categoryOfOrganization.Notes);
            Assert.True(categoryOfOrganization.IsValid);
        }
Ejemplo n.º 2
0
        public async Task TestOrganizationTypeEC_CategoryRequired()
        {
            var categoryToTest = BuildOrganizationType();
            var category       = await OrganizationTypeEC.GetOrganizationTypeEC(categoryToTest);

            var isObjectValidInit = category.IsValid;

            category.Name = string.Empty;

            Assert.NotNull(category);
            Assert.True(isObjectValidInit);
            Assert.False(category.IsValid);
            Assert.Equal("Name", category.BrokenRulesCollection[0].Property);
        }
Ejemplo n.º 3
0
        private async Task BuildOrganization(OrganizationEC organizationToBuild)
        {
            organizationToBuild.Name             = "organization name";
            organizationToBuild.OrganizationType =
                await OrganizationTypeEC.GetOrganizationTypeEC(new OrganizationType()
            {
                Id = 1
            });

            organizationToBuild.Notes              = "notes for org";
            organizationToBuild.LastUpdatedBy      = "edm";
            organizationToBuild.LastUpdatedDate    = DateTime.Now;
            organizationToBuild.DateOfFirstContact = DateTime.Now;
        }
Ejemplo n.º 4
0
        private async Task BuildValidOrganization(OrganizationER organization)
        {
            organization.Name             = "organization name";
            organization.OrganizationType =
                await OrganizationTypeEC.GetOrganizationTypeEC(new OrganizationType()
            {
                Id = 1
            });

            organization.CategoryOfOrganization =
                await CategoryOfOrganizationEC.GetCategoryOfOrganizationEC(new CategoryOfOrganization()
            {
                Id = 1
            });

            organization.Notes              = "notes for org";
            organization.LastUpdatedBy      = "edm";
            organization.LastUpdatedDate    = DateTime.Now;
            organization.DateOfFirstContact = DateTime.Now;
        }