public async Task Post(RecordsListDto recordsListDto)
    {
        if (recordsListDto == null)
        {
            throw new ArgumentNullException(nameof(recordsListDto));
        }

        await Repository.Create(new RecordsList("Best of Year List", "https://alllists.com")).ConfigureAwait(false);
    }
Exemplo n.º 2
0
    public async Task PostValidListWhenDatabaseIsEmpty()
    {
        var db  = new FakeDatabase();
        var sut = new RecordsListController(db);

        var dto = new RecordsListDto
        {
            Title  = "Best of Year List",
            Source = "https://alllists.com"
        };

        await sut.Post(dto);

        var expected = new RecordsList(dto.Title, dto.Source);

        Assert.Contains(expected, db);
    }