Exemplo n.º 1
0
        public async Task Update_Series_LogoPath()
        {
            var series = await SeriesHelpers.CreateValidSeries();

            var repository = new SeriesRepository(_fixture.Context);

            (await repository.ExistsAsync(series.Id)).Should().BeTrue();

            var sut = await repository.GetAsync(series.Id);

            var seriesId = sut.Id;

            sut.Should().NotBeNull();
            sut.PicturePath.Should().Be(@"\\filepath\file.jpg");

            await SeriesHelpers.UpdateSeriesPicturePath(sut.Id, @"\\filepath\newFile.jpg");

            await _fixture.Context.Entry(sut).ReloadAsync();

            sut.PicturePath.Should().Be(@"\\filepath\newFile.jpg");
            sut.Id.Should().Be(seriesId);
        }