public async Task AddClientPropertyAsync() { using (var context = new AdminDbContext(_dbContextOptions, _storeOptions, _operationalStore)) { IClientRepository clientRepository = new ClientRepository(context); //Generate random new client without id var client = ClientMock.GenerateRandomClient(0); //Add new client await clientRepository.AddClientAsync(client); //Get new client var clientEntity = await clientRepository.GetClientAsync(client.Id); //Assert new client clientEntity.Should().BeEquivalentTo(client, options => options.Excluding(o => o.Id)); //Generate random new Client property var clientProperty = ClientMock.GenerateRandomClientProperty(0); //Add new client property await clientRepository.AddClientPropertyAsync(clientEntity.Id, clientProperty); //Get new client property var newClientProperty = await context.ClientProperties.Where(x => x.Id == clientProperty.Id) .SingleOrDefaultAsync(); newClientProperty.Should().BeEquivalentTo(clientProperty, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } }