Abp.Zero.SampleApp.Tests.Organizations.OrganizationUnitManager_Tests.GetOUOrNull(string)

Here are the examples of the csharp api class Abp.Zero.SampleApp.Tests.Organizations.OrganizationUnitManager_Tests.GetOUOrNull(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

1. Example

View license
[Fact]
        public async Task Should_Create_Root_OU()
        {
            //Act
            await _organizationUnitManager.CreateAsync(new OrganizationUnit(AbpSession.TenantId, "Root 1"));

            //Assert
            var root1 = GetOUOrNull("Root 1");
            root1.ShouldNotBeNull();
            root1.Code.ShouldBe(OrganizationUnit.CreateCode(3));
        }

2. Example

View license
[Fact]
        public async Task Should_Create_Root_OU()
        {
            //Act
            await _organizationUnitManager.CreateAsync(new OrganizationUnit(AbpSession.TenantId, "Root 1"));

            //Assert
            var root1 = GetOUOrNull("Root 1");
            root1.ShouldNotBeNull();
            root1.Code.ShouldBe(OrganizationUnit.CreateCode(3));
        }

3. Example

View license
[Fact]
        public async Task Should_Create_Child_OU()
        {
            //Arrange
            var ou11 = GetOU("OU11");

            //Act
            await _organizationUnitManager.CreateAsync(new OrganizationUnit(AbpSession.TenantId, "OU11 New Child", ou11.Id));

            //Assert
            var newChild = GetOUOrNull("OU11 New Child");
            newChild.ShouldNotBeNull();
            newChild.ParentId.ShouldBe(ou11.Id);
            newChild.Code.ShouldBe(OrganizationUnit.CreateCode(1, 1, 3));
        }

4. Example

View license
[Fact]
        public async Task Should_Create_Child_OU()
        {
            //Arrange
            var ou11 = GetOU("OU11");

            //Act
            await _organizationUnitManager.CreateAsync(new OrganizationUnit(AbpSession.TenantId, "OU11 New Child", ou11.Id));

            //Assert
            var newChild = GetOUOrNull("OU11 New Child");
            newChild.ShouldNotBeNull();
            newChild.ParentId.ShouldBe(ou11.Id);
            newChild.Code.ShouldBe(OrganizationUnit.CreateCode(1, 1, 3));
        }