public async Task Create_ValidParameters_SetsCorrectResourceAndMethod() { var sut = new LabelRepository(_requestFactory); await sut.Create(0, "name", "color"); _requestFactory.Received().Create("projects/{projectId}/labels", Method.Post); }
public async Task Create_ValidParameters_AddsProjectIdUrlSegment() { const uint expected = 0; var sut = new LabelRepository(_requestFactory); await sut.Create(expected, "name", "color"); _request.Received().AddUrlSegment("projectId", expected); }
public async Task Create_ValidParameters_AddsNameParameter() { const string expected = "name"; var sut = new LabelRepository(_requestFactory); await sut.Create(0, expected, "color"); _request.Received().AddParameter("name", expected); }
public async Task Create_DescriptionIsSet_AddsDescriptionParameter() { const string expected = "description"; var sut = new LabelRepository(_requestFactory); await sut.Create(0, "name", "color", expected); _request.Received().AddParameterIfNotNull("description", expected); }
public async Task Create_NameIsNull_ThrowsArgumentNullException() { var sut = new LabelRepository(_requestFactory); await Assert.ThrowsAsync <ArgumentNullException>(() => sut.Create(0, null, "color")); }