public void PostsToTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new StagesClient(connection); var newStage = new NewStage("name", 1); client.Create(newStage); connection.Received().Post <Stage>(Arg.Is <Uri>(u => u.ToString() == "stages"), Arg.Is <NewStage>(nc => nc.Name == "name" && nc.PipelineId == 1)); }
public async Task EnsuresNonNullArguments() { var client = new StagesClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.Create(null)); }