public void RequestsCorrectUrl() { var endpoint = new Uri("user/keys", UriKind.Relative); var client = Substitute.For<IApiConnection>(); var sshKeysClient = new SshKeysClient(client); sshKeysClient.GetAllForCurrent(); client.Received().GetAll<SshKey>(endpoint); }
public void RequestsCorrectUrl() { var endpoint = new Uri("user/keys", UriKind.Relative); var client = Substitute.For <IApiConnection>(); var sshKeysClient = new SshKeysClient(client); sshKeysClient.GetAllForCurrent(); client.Received().GetAll <SshKey>(endpoint); }
public void SendsCreateToCorrectUrl() { var endpoint = new Uri("user/keys/42", UriKind.Relative); var client = Substitute.For <IApiConnection>(); var sshKeysClient = new SshKeysClient(client); sshKeysClient.Delete(42); client.Received().Delete(endpoint); }
public void SendsUpdateToCorrectUrl() { var endpoint = new Uri("user/keys/42", UriKind.Relative); var data = new SshKeyUpdate(); var client = Substitute.For<IApiConnection>(); var sshKeysClient = new SshKeysClient(client); sshKeysClient.Update(42, data); client.Received().Patch<SshKey>(endpoint, data); }
public void SendsCreateToCorrectUrl() { var endpoint = new Uri("user/keys", UriKind.Relative); var data = new SshKeyUpdate(); var client = Substitute.For <IApiConnection>(); var sshKeysClient = new SshKeysClient(client); sshKeysClient.Create(data); client.Received().Post <SshKey>(endpoint, data); }
public async Task EnsuresArgumentsNotNull() { var userEndpoint = new SshKeysClient(Substitute.For<IApiConnection>()); await Assert.ThrowsAsync<ArgumentNullException>(() => userEndpoint.Update(1, null)); }
public void SendsCreateToCorrectUrl() { var endpoint = new Uri("user/keys/42", UriKind.Relative); var client = Substitute.For<IApiConnection>(); var sshKeysClient = new SshKeysClient(client); sshKeysClient.Delete(42); client.Received().Delete(endpoint); }
public async Task EnsuresArgumentsNotNull() { var userEndpoint = new SshKeysClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => userEndpoint.Update(1, null)); }