public async Task EnsuresNonNullAndNonEmptyArguments() { var connection = Substitute.For <IApiConnection>(); var client = new MigrationsClient(connection); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetArchive(null, 69)); await Assert.ThrowsAsync <ArgumentException>(() => client.GetArchive("", 69)); }
public void RequestsCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new MigrationsClient(connection); client.GetArchive("fake", 69); connection.Connection.Received().Get <byte[]>( Arg.Is <Uri>(u => u.ToString() == "orgs/fake/migrations/69/archive"), null, "application/vnd.github.wyandotte-preview+json"); }
public void RequestsCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new MigrationsClient(connection); client.GetArchive("fake", 69); connection.Connection.Received().Get <byte[]>( Arg.Is <Uri>(u => u.ToString() == "orgs/fake/migrations/69/archive"), null, AcceptHeaders.MigrationsApiPreview); }
public async Task EnsuresNonNullAndNonEmptyArguments() { var connection = Substitute.For<IApiConnection>(); var client = new MigrationsClient(connection); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetArchive(null, 69)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetArchive("", 69)); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new MigrationsClient(connection); client.GetArchive("fake", 69); connection.Connection.Received().Get<byte[]>( Arg.Is<Uri>(u => u.ToString() == "orgs/fake/migrations/69/archive"), null, AcceptHeaders.MigrationsApiPreview); }