public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); client.GetAllForRepositoryNetwork("fake", "repo"); connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "networks/fake/repo/events")); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); client.GetAll(); connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "events")); }
public async Task EnsuresArgumentsNotNull() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); await AssertEx.Throws<ArgumentNullException>(async () => await client.GetAllForRepositoryNetwork(null, "name")); await AssertEx.Throws<ArgumentException>(async () => await client.GetAllForRepositoryNetwork("", "name")); await AssertEx.Throws<ArgumentNullException>(async () => await client.GetAllForRepositoryNetwork("owner", null)); await AssertEx.Throws<ArgumentException>(async () => await client.GetAllForRepositoryNetwork("owner", "")); }
public async Task EnsuresArgumentsNotNull() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); await AssertEx.Throws<ArgumentNullException>(async () => await client.GetAllForOrganization(null)); await AssertEx.Throws<ArgumentException>(async () => await client.GetAllForOrganization("")); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); client.GetForAnOrganization("fake", "org"); connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "users/fake/events/orgs/org")); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); client.GetUserPerformedPublic("fake"); connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "users/fake/events/public")); }
public async Task EnsuresArgumentsNotNull() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForAnOrganization(null, "org")); await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForAnOrganization("", "org")); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForAnOrganization("fake", null)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForAnOrganization("fake", "")); }
public async Task EnsuresArgumentsNotNull() { var connection = Substitute.For<IApiConnection>(); var client = new EventsClient(connection); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllUserPerformedPublic(null)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllUserPerformedPublic("")); }