public void PostsToTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new PersonsClient(connection); var newPerson = new NewPerson("name"); client.Create(newPerson); connection.Received().Post <Person>(Arg.Is <Uri>(u => u.ToString() == "persons"), Arg.Is <NewPerson>(d => d.Name == "name")); }
public async Task EnsuresNonNullArguments() { var client = new PersonsClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.Create(null)); }