public async Task EnsuresNonNullArguments() { var connection = Substitute.For<IApiConnection>(); var client = new TeamsClient(connection); AssertEx.Throws<ArgumentNullException>(async () => await client.CreateTeam("", new NewTeam("superstars"))); AssertEx.Throws<ArgumentException>(async () => await client.CreateTeam("name", null)); }
public void EnsuresNonNullArguments() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); var team = new NewTeam("superstars"); Assert.Throws <ArgumentNullException>(() => client.CreateTeam(null, team)); Assert.Throws <ArgumentException>(() => client.CreateTeam("", team)); Assert.Throws <ArgumentNullException>(() => client.CreateTeam("name", null)); }
public void EnsuresNonNullArguments() { var connection = Substitute.For<IApiConnection>(); var client = new TeamsClient(connection); var team = new NewTeam("superstars"); Assert.Throws<ArgumentNullException>(() => client.CreateTeam(null, team)); Assert.Throws<ArgumentException>(() => client.CreateTeam("", team)); Assert.Throws<ArgumentNullException>(() => client.CreateTeam("name", null)); }
public async Task EnsuresNonNullArguments() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); AssertEx.Throws <ArgumentNullException>(async() => await client.CreateTeam("", new NewTeam("superstars"))); AssertEx.Throws <ArgumentException>(async() => await client.CreateTeam("name", null)); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new TeamsClient(connection); var team = new NewTeam("Octokittens"); client.CreateTeam("orgName", team); connection.Received().Post<Team>(Arg.Is<Uri>(u => u.ToString() == "orgs/orgName/teams"), team); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); var team = new NewTeam("Octokittens"); client.CreateTeam("orgName", team); connection.Received().Post <Team>(Arg.Is <Uri>(u => u.ToString() == "orgs/orgName/teams"), team); }