public void RequestsTheCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new UserGpgKeysClient(connection); var expectedUri = "user/gpg_keys"; client.Create(new NewGpgKey("ABCDEFG")); connection.Received().Post<GpgKey>( Arg.Is<Uri>(u => u.ToString() == expectedUri), Arg.Any<object>(), Arg.Is<string>(s => s == "application/vnd.github.cryptographer-preview")); }
public void PassesRequestObject() { var connection = Substitute.For <IApiConnection>(); var client = new UserGpgKeysClient(connection); var expectedUri = "user/gpg_keys"; client.Create(new NewGpgKey("ABCDEFG")); connection.Received().Post <GpgKey>( Arg.Is <Uri>(u => u.ToString() == expectedUri), Arg.Is <NewGpgKey>(a => a.ArmoredPublicKey == "ABCDEFG")); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new UserGpgKeysClient(connection); var expectedUri = "user/gpg_keys"; client.Create(new NewGpgKey("ABCDEFG")); connection.Received().Post <GpgKey>( Arg.Is <Uri>(u => u.ToString() == expectedUri), Arg.Any <object>()); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new UserGpgKeysClient(connection); var expectedUri = "user/gpg_keys"; client.Create(new NewGpgKey("ABCDEFG")); connection.Received().Post <GpgKey>( Arg.Is <Uri>(u => u.ToString() == expectedUri), Arg.Any <object>(), Arg.Is <string>(s => s == "application/vnd.github.cryptographer-preview")); }
public void PassesRequestObject() { var connection = Substitute.For<IApiConnection>(); var client = new UserGpgKeysClient(connection); var expectedUri = "user/gpg_keys"; client.Create(new NewGpgKey("ABCDEFG")); connection.Received().Post<GpgKey>( Arg.Is<Uri>(u => u.ToString() == expectedUri), Arg.Is<NewGpgKey>(a => a.ArmoredPublicKey == "ABCDEFG"), Arg.Any<string>()); }
public async Task EnsuresNonNullArgument() { var client = new UserGpgKeysClient(Substitute.For<IApiConnection>()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create(null)); }
public async Task EnsuresNonNullArgument() { var client = new UserGpgKeysClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.Create(null)); }