public async Task Created_dto_should_match_fetched_dto()
        {
            var(resultCreated, roleCreated) = await rolesService.AddRole(TestRole).UnpackSingleOrDefault();

            var(resultFetch, roleFetched) = await rolesService.GetRole(roleCreated.Id).UnpackSingleOrDefault();

            Assert.True(resultCreated.Success);
            Assert.True(resultFetch.Success);
            Assert.Equal(roleCreated, roleFetched);
        }
Ejemplo n.º 2
0
        private async Task LoadRoles()
        {
            Role1 = new RoleDto
            {
                Name = $"Role 1{GetUniqueId()}"
            };

            Role2 = new RoleDto
            {
                Name = $"Role 2{GetUniqueId()}",
            };

            var role1Result = await rolesService.AddRole(Role1);

            var role2Result = await rolesService.AddRole(Role2);

            Role1 = role1Result.Data.Single();
            Role2 = role2Result.Data.Single();
        }
Ejemplo n.º 3
0
        private async Task LoadTenantsAndRoles()
        {
            Tenant1 = new TenantDto
            {
                Name = $"Tenant 1{GetUniqueId()}"
            };

            Tenant2 = new TenantDto
            {
                Name = $"Tenant 1{GetUniqueId()}"
            };

            Role1 = new RoleDto
            {
                Name = $"Role 1{GetUniqueId()}"
            };

            Role2 = new RoleDto
            {
                Name = $"Role 2{GetUniqueId()}"
            };

            var tenant1Result = await tenantsService.AddTenant(Tenant1);

            var tenant2Result = await tenantsService.AddTenant(Tenant2);

            var role1Result = await rolesService.AddRole(Role1);

            var role2Result = await rolesService.AddRole(Role2);

            Tenant1 = tenant1Result.Data.Single();
            Tenant2 = tenant2Result.Data.Single();

            Role1 = role1Result.Data.Single();
            Role2 = role2Result.Data.Single();
        }