Beispiel #1
0
        public async Task Can_Get_SpecificBusinessType_That_Is_Available()
        {
            //Arrange
            var orgId               = TestEnvironment.DefaultOrganizationId;
            var businessTypeName    = A <string>();
            var createdBusinessType = await EntityOptionHelper.CreateBusinessTypeAsync(businessTypeName, orgId);

            var organisation = await OrganizationHelper.GetOrganizationAsync(orgId);

            var businessTypes = await BusinessTypeV2Helper.GetBusinessTypesAsync(organisation.Uuid.Value, 100, 0); //100 should be more than enough to get all.

            var businessType = businessTypes.Where(x => x.Name.Equals(businessTypeName)).First();                  //Get the newly created businessType.

            //Act
            var businessTypeResult = await BusinessTypeV2Helper.GetBusinessTypeAsync(businessType.Uuid, organisation.Uuid.Value);

            //Assert
            Assert.Equal(businessTypeName, businessTypeResult.Name);
            Assert.Equal(businessType.Uuid, businessTypeResult.Uuid);
            Assert.True(businessTypeResult.IsAvailable);
        }