public void TryAddPostamatTest() { var repository = GetPostamatRepository(); var postamat = new Postamat { Address = "Lenina 10", IsWorking = true }; Assert.Throws <Exception>(() => repository.Add(postamat)); }
private List <Postamat> GeneratePostamats() { var postamats = new List <Postamat>(); for (var i = 0; i < 10; i++) { var postamat = new Postamat { Id = i, Address = $"Baker street 2{i}", IsWorking = i % 3 != 0 }; postamats.Add(postamat); } return(postamats); }
/// <inheritdoc /> public Task <Postamat> UpdateAsync(Postamat updatedPostamat, CancellationToken token) { return(Task.FromResult(Update(updatedPostamat))); }
/// <inheritdoc /> public Task <Postamat> AddAsync(Postamat newPostamat, CancellationToken token) { return(Task.FromResult(Add(newPostamat))); }
/// <inheritdoc /> public Postamat Update(Postamat updatedPostamat) { throw new Exception(); }
/// <inheritdoc /> public Postamat Add(Postamat newPostamat) { throw new Exception(); }