public static async Task <bool> CheckIfSizeExists(size.SizeId id) { var connectionString = ConnectivityService.GetConnectionString("TEMP"); var context = new SplurgeStopDbContext(connectionString); var repository = new SizeRepository(context); return(await repository.ExistsAsync(id)); }
public async Task Size_inserted_to_database() { Size size = await CreateValidSize(); var repository = new SizeRepository(fixture.context); var sut = await repository.LoadAsync(size.Id); Assert.True(await repository.ExistsAsync(sut.Id)); Assert.NotEmpty(sut.Amount); }
public async Task Update_Size_name() { Size size = await CreateValidSize(); var repository = new SizeRepository(fixture.context); Assert.True(await repository.ExistsAsync(size.Id)); var sut = await repository.LoadAsync(size.Id); var sizeId = sut.Id; Assert.NotNull(sut); Assert.Equal("L", sut.Amount); await UpdateSizeAmount(sut.Id, "XL"); await fixture.context.Entry(sut).ReloadAsync(); Assert.Equal("XL", sut.Amount); Assert.Equal(sizeId, sut.Id); }