Skip to content

Commit

Permalink
fix: deprecated nunit methods missing
Browse files Browse the repository at this point in the history
  • Loading branch information
DXTimer committed Dec 8, 2023
1 parent 5e108a9 commit 9f35c25
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 97 deletions.
8 changes: 4 additions & 4 deletions src/dnsimple-test/ClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ public void CanSetTheBaseUrl()
[Test]
public void HasHttpService()
{
Assert.IsInstanceOf(typeof(HttpService), _client.Http);
Assert.That(_client.Http, Is.InstanceOf<HttpService>());
}

[Test]
public void HasIdentityService()
{
Assert.IsInstanceOf(typeof(IdentityService), _client.Identity);
Assert.That(_client.Identity, Is.InstanceOf<IdentityService>());
}

[Test]
public void HasOAuthService()
{
Assert.IsInstanceOf(typeof(OAuth2Service), _client.OAuth);
Assert.That(_client.OAuth, Is.InstanceOf<OAuth2Service>());
}

[Test]
Expand All @@ -51,7 +51,7 @@ public void HasVersion()
[Test]
public void ReturnsInstanceOfTheIdentityService()
{
Assert.IsInstanceOf(typeof(IdentityService), _client.Identity);
Assert.That(_client.Identity, Is.InstanceOf<IdentityService>());
}

[Test]
Expand Down
22 changes: 11 additions & 11 deletions src/dnsimple-test/Services/CertificatesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public void CertificatesResponse()
Assert.That(certificate.First().Years, Is.EqualTo(1));
Assert.That(certificate.First().Csr, Is.EqualTo(expectedCSR));
Assert.That(certificate.First().State, Is.EqualTo("issued"));
Assert.IsFalse(certificate.First().AutoRenew);
Assert.IsEmpty(certificate.First().AlternateNames);
Assert.That(certificate.First().AutoRenew, Is.False);
Assert.That(certificate.First().AlternateNames, Is.Empty);
Assert.That(certificate.First().AuthorityIdentifier, Is.EqualTo("letsencrypt"));
Assert.That(certificate.First().CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T20:15:09Z")));
Assert.That(certificate.First().UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T20:30:08Z")));
Expand Down Expand Up @@ -174,7 +174,7 @@ public void GetCertificate(long accountId, string domainName,
Assert.That(certificate.Years, Is.EqualTo(1));
Assert.That(certificate.Csr, Is.EqualTo(expectedCertificate));
Assert.That(certificate.State, Is.EqualTo("issued"));
Assert.IsFalse(certificate.AutoRenew);
Assert.That(certificate.AutoRenew, Is.False);
Assert.That(certificate.AlternateNames, Is.Empty);
Assert.That(certificate.AuthorityIdentifier, Is.EqualTo("letsencrypt"));
Assert.That(certificate.CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T18:54:17Z")));
Expand Down Expand Up @@ -261,8 +261,8 @@ public void DownloadCertificate(long accountId, string domainName,
Assert.Multiple(() =>
{
Assert.That(certificate.ServerCertificate, Is.EqualTo(serverCertificate));
Assert.IsNull(certificate.RootCertificate);
Assert.Contains(chainCertificate, certificate.IntermediateCertificates);
Assert.That(certificate.RootCertificate, Is.Null);
Assert.That(certificate.IntermediateCertificates, Contains.Item(chainCertificate));

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
});
Expand Down Expand Up @@ -342,7 +342,7 @@ public void PurchaseLetsEncryptCertificate(long accountId,
Assert.That(certificateOrdered.Id, Is.EqualTo(101967));
Assert.That(certificateOrdered.CertificateId, Is.EqualTo(101967));
Assert.That(certificateOrdered.State, Is.EqualTo("new"));
Assert.IsFalse(certificateOrdered.AutoRenew);
Assert.That(certificateOrdered.AutoRenew, Is.False);
Assert.That(certificateOrdered.CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T18:54:17Z")));
Assert.That(certificateOrdered.UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T18:54:17Z")));

Expand All @@ -369,9 +369,9 @@ public void IssueLetsEncryptCertificate(long accountId,
Assert.That(certificate.DomainId, Is.EqualTo(289333));
Assert.That(certificate.CommonName, Is.EqualTo("www.bingo.pizza"));
Assert.That(certificate.Years, Is.EqualTo(1));
Assert.IsNull(certificate.Csr);
Assert.That(certificate.Csr, Is.Null);
Assert.That(certificate.State, Is.EqualTo("requesting"));
Assert.IsFalse(certificate.AutoRenew);
Assert.That(certificate.AutoRenew, Is.False);
Assert.That(certificate.AlternateNames, Is.Empty);
Assert.That(certificate.AuthorityIdentifier, Is.EqualTo("letsencrypt"));

Expand Down Expand Up @@ -403,7 +403,7 @@ public void PurchaseLetsEncryptCertificateRenewal(long accountId,
Assert.That(renewalPurchased.OldCertificateId, Is.EqualTo(101967));
Assert.That(renewalPurchased.NewCertificateId, Is.EqualTo(101972));
Assert.That(renewalPurchased.State, Is.EqualTo("new"));
Assert.IsFalse(renewalPurchased.AutoRenew);
Assert.That(renewalPurchased.AutoRenew, Is.False);
Assert.That(renewalPurchased.CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T19:56:20Z")));
Assert.That(renewalPurchased.UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-18T19:56:20Z")));

Expand Down Expand Up @@ -434,9 +434,9 @@ public void IssueLetsEncryptCertificateRenewal(long accountId,
Assert.That(renewalIssued.DomainId, Is.EqualTo(289333));
Assert.That(renewalIssued.CommonName, Is.EqualTo("www.bingo.pizza"));
Assert.That(renewalIssued.Years, Is.EqualTo(1));
Assert.IsNull(renewalIssued.Csr);
Assert.That(renewalIssued.Csr, Is.Null);
Assert.That(renewalIssued.State, Is.EqualTo("requesting"));
Assert.IsFalse(renewalIssued.AutoRenew);
Assert.That(renewalIssued.AutoRenew, Is.False);
Assert.That(renewalIssued.AlternateNames, Is.Empty);
Assert.That(renewalIssued.AuthorityIdentifier, Is.EqualTo("letsencrypt"));

Expand Down
2 changes: 1 addition & 1 deletion src/dnsimple-test/Services/ContactsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void ContactsResponse()
Assert.That(contact.Phone, Is.EqualTo("+18001234567"));
Assert.That(contact.Fax, Is.EqualTo("+18011234567"));
Assert.That(contact.Address1, Is.EqualTo("Italian Street, 10"));
Assert.IsEmpty(contact.Address2);
Assert.That(contact.Address2, Is.Empty);
Assert.That(contact.City, Is.EqualTo("Roma"));
Assert.That(contact.StateProvince, Is.EqualTo("RM"));
Assert.That(contact.PostalCode, Is.EqualTo("00100"));
Expand Down
8 changes: 4 additions & 4 deletions src/dnsimple-test/Services/DomainsCollaboratorsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void CollaboratorsResponse()
Assert.That(response.Data.First().DomainName, Is.EqualTo("example.com"));
Assert.That(response.Data.First().UserId, Is.EqualTo(999));
Assert.That(response.Data.First().UserEmail, Is.EqualTo("[email protected]"));
Assert.IsFalse(response.Data.First().Invitation);
Assert.That(response.Data.First().Invitation, Is.False);

Assert.That(response.Data.Count, Is.EqualTo(2));
}
Expand Down Expand Up @@ -73,7 +73,7 @@ public void AddCollaborator(string domainIdentifier, string expectedUrl)
{
Assert.That(collaborator.UserId, Is.EqualTo(999));
Assert.That(collaborator.UserEmail, Is.EqualTo("[email protected]"));
Assert.IsFalse(collaborator.Invitation);
Assert.That(collaborator.Invitation, Is.False);

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
});
Expand Down Expand Up @@ -107,8 +107,8 @@ public void InviteCollaborator(string domainIdentifier, string expectedUrl)
Assert.Multiple(() =>
{
Assert.That(collaborator.Data.UserEmail, Is.EqualTo("[email protected]"));
Assert.IsNull(collaborator.Data.UserId);
Assert.IsTrue(collaborator.Data.Invitation);
Assert.That(collaborator.Data.UserId, Is.Null);
Assert.That(collaborator.Data.Invitation, Is.True);

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
});
Expand Down
4 changes: 2 additions & 2 deletions src/dnsimple-test/Services/DomainsDnssecTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void EnableDnssec(long accountId, string domainIdentifier, string expecte

Assert.Multiple(() =>
{
Assert.IsTrue(response.Data.Enabled);
Assert.That(response.Data.Enabled, Is.True);
Assert.That(response.Data.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(response.Data.UpdatedAt, Is.EqualTo(UpdatedAt));

Expand Down Expand Up @@ -83,7 +83,7 @@ public void GetDnssec(long accountId, string domainIdentifier, string expectedUr

Assert.Multiple(() =>
{
Assert.IsTrue(response.Data.Enabled);
Assert.That(response.Data.Enabled, Is.True);
Assert.That(response.Data.CreatedAt, Is.EqualTo(dateTime));
Assert.That(response.Data.UpdatedAt, Is.EqualTo(dateTime));

Expand Down
2 changes: 1 addition & 1 deletion src/dnsimple-test/Services/DomainsPushesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void InitiatePush(long accountId, string domainIdentifier, string expecte
{
Assert.That(push.Data.Id, Is.EqualTo(1));
Assert.That(push.Data.DomainId, Is.EqualTo(100));
Assert.IsNull(push.Data.ContactId);
Assert.That(push.Data.ContactId, Is.Null);
Assert.That(push.Data.AccountId, Is.EqualTo(2020));
Assert.That(push.Data.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(push.Data.UpdatedAt, Is.EqualTo(UpdatedAt));
Expand Down
16 changes: 8 additions & 8 deletions src/dnsimple-test/Services/DomainsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public void DomainsResponse()
Assert.That(domains.First().Name, Is.EqualTo("example-alpha.com"));
Assert.That(domains.First().UnicodeName, Is.EqualTo("example-alpha.com"));
Assert.That(domains.First().State, Is.EqualTo("registered"));
Assert.IsFalse(domains.First().AutoRenew);
Assert.IsFalse(domains.First().PrivateWhois);
Assert.That(domains.First().AutoRenew, Is.False);
Assert.That(domains.First().PrivateWhois, Is.False);
Assert.That(domains.First().ExpiresAt, Is.EqualTo(Convert.ToDateTime("2021-06-05T02:15:00Z")));
Assert.That(domains.First().CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-04T19:15:14Z")));
Assert.That(domains.First().UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-04T19:15:21Z")));
Expand Down Expand Up @@ -104,8 +104,8 @@ public void GetDomain(string domainIdentifier, string expectedUrl)
Assert.That(domain.Name, Is.EqualTo("example-alpha.com"));
Assert.That(domain.UnicodeName, Is.EqualTo("example-alpha.com"));
Assert.That(domain.State, Is.EqualTo("registered"));
Assert.IsFalse(domain.AutoRenew);
Assert.IsFalse(domain.PrivateWhois);
Assert.That(domain.AutoRenew, Is.False);
Assert.That(domain.PrivateWhois, Is.False);
Assert.That(domain.ExpiresAt, Is.EqualTo(Convert.ToDateTime("2021-06-05T02:15:00Z")));
Assert.That(domain.CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-04T19:15:14Z")));
Assert.That(domain.UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-04T19:15:21Z")));
Expand Down Expand Up @@ -138,13 +138,13 @@ public void CreateDomain(string expectedUrl)
{
Assert.That(domain.Id, Is.EqualTo(181985));
Assert.That(domain.AccountId, Is.EqualTo(1385));
Assert.IsNull(domain.RegistrantId);
Assert.That(domain.RegistrantId, Is.Null);
Assert.That(domain.Name, Is.EqualTo("example-beta.com"));
Assert.That(domain.UnicodeName, Is.EqualTo("example-beta.com"));
Assert.That(domain.State, Is.EqualTo("hosted"));
Assert.IsFalse(domain.AutoRenew);
Assert.IsFalse(domain.PrivateWhois);
Assert.IsNull(domain.ExpiresAt);
Assert.That(domain.AutoRenew, Is.False);
Assert.That(domain.PrivateWhois, Is.False);
Assert.That(domain.ExpiresAt, Is.Null);
Assert.That(domain.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(domain.UpdatedAt, Is.EqualTo(UpdatedAt));

Expand Down
6 changes: 3 additions & 3 deletions src/dnsimple-test/Services/HttpTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class HttpTest
public void ReturnsARequestBuilder()
{
var http = new HttpService(new RestClient(), new RequestBuilder());
Assert.IsInstanceOf(typeof(RequestBuilder),
http.RequestBuilder(""));
Assert.That(http.RequestBuilder(""), Is.InstanceOf<RequestBuilder>());

}

[Test]
Expand Down Expand Up @@ -146,7 +146,7 @@ public void Resets()
{
_builder.Method(Method.HEAD);

Assert.IsNull(_builder.Reset().Request);
Assert.That(_builder.Reset().Request, Is.Null);
}

[Test]
Expand Down
22 changes: 11 additions & 11 deletions src/dnsimple-test/Services/RegistrarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public void CheckDomain(long accountId, string domainName,
Assert.Multiple(() =>
{
Assert.That(check.Domain, Is.EqualTo(domainName));
Assert.IsTrue(check.Available);
Assert.IsTrue(check.Premium);
Assert.That(check.Available, Is.True);
Assert.That(check.Premium, Is.True);

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
});
Expand Down Expand Up @@ -155,8 +155,8 @@ public void RegisterDomain(long accountId, string domainName,
Assert.That(registeredDomain.RegistrantId, Is.EqualTo(2));
Assert.That(registeredDomain.Period, Is.EqualTo(1));
Assert.That(registeredDomain.State, Is.EqualTo("new"));
Assert.IsFalse(registeredDomain.AutoRenew);
Assert.IsFalse(registeredDomain.WhoisPrivacy);
Assert.That(registeredDomain.AutoRenew, Is.False);
Assert.That(registeredDomain.WhoisPrivacy, Is.False);
Assert.That(registeredDomain.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(registeredDomain.UpdatedAt, Is.EqualTo(UpdatedAt));

Expand All @@ -181,8 +181,8 @@ public void GetDomainRegistration(long accountId, string domainName,
Assert.That(domain.RegistrantId, Is.EqualTo(2715));
Assert.That(domain.Period, Is.EqualTo(1));
Assert.That(domain.State, Is.EqualTo("registering"));
Assert.IsFalse(domain.AutoRenew);
Assert.IsFalse(domain.WhoisPrivacy);
Assert.That(domain.AutoRenew, Is.False);
Assert.That(domain.WhoisPrivacy, Is.False);
Assert.That(domain.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(domain.UpdatedAt, Is.EqualTo(UpdatedAt));

Expand Down Expand Up @@ -388,8 +388,8 @@ public void GetDomainTransfer(long accountId, string domainName, long domainTans
Assert.That(domainTransfer.DomainId, Is.EqualTo(182245));
Assert.That(domainTransfer.RegistrantId, Is.EqualTo(2715));
Assert.That(domainTransfer.State, Is.EqualTo("cancelled"));
Assert.False(domainTransfer.AutoRenew);
Assert.False(domainTransfer.WhoisPrivacy);
Assert.That(domainTransfer.AutoRenew, Is.False);
Assert.That(domainTransfer.WhoisPrivacy, Is.False);
Assert.That(domainTransfer.StatusDescription, Is.EqualTo("Canceled by customer"));
Assert.That(domainTransfer.CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-05T18:08:00Z")));
Assert.That(domainTransfer.UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-05T18:10:01Z")));
Expand All @@ -409,9 +409,9 @@ public void CancelDomainTransfer(long accountId, string domainName, long domainT
Assert.That(domainTransfer.DomainId, Is.EqualTo(182245));
Assert.That(domainTransfer.RegistrantId, Is.EqualTo(2715));
Assert.That(domainTransfer.State, Is.EqualTo("transferring"));
Assert.False(domainTransfer.AutoRenew);
Assert.False(domainTransfer.WhoisPrivacy);
Assert.IsNull(domainTransfer.StatusDescription);
Assert.That(domainTransfer.AutoRenew, Is.False);
Assert.That(domainTransfer.WhoisPrivacy, Is.False);
Assert.That(domainTransfer.StatusDescription, Is.Null);
Assert.That(domainTransfer.CreatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-05T18:08:00Z")));
Assert.That(domainTransfer.UpdatedAt, Is.EqualTo(Convert.ToDateTime("2020-06-05T18:08:04Z")));
});
Expand Down
10 changes: 5 additions & 5 deletions src/dnsimple-test/Services/RegistrarWhoisPrivacyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void GetWhoisPrivacy(long accountId, string domain, string expectedUrl)
Assert.That(privacy.Id, Is.EqualTo(1));
Assert.That(privacy.DomainId, Is.EqualTo(2));
Assert.That(privacy.ExpiresOn, Is.EqualTo(ExpiresOn));
Assert.IsTrue(privacy.Enabled);
Assert.That(privacy.Enabled, Is.True);
Assert.That(privacy.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(privacy.UpdatedAt, Is.EqualTo(UpdatedAt));

Expand All @@ -89,7 +89,7 @@ public void EnableWhoisPrivacy(long accountId, string domain, string expectedUrl

Assert.Multiple(() =>
{
Assert.IsTrue(privacy.Enabled);
Assert.That(privacy.Enabled, Is.True);

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
Assert.That(client.HttpMethodUsed(), Is.EqualTo(Method.PUT));
Expand All @@ -108,7 +108,7 @@ public void PurchaseAndEnableWhoisPrivacy(long accountId, string domain, string

Assert.Multiple(() =>
{
Assert.IsNull(privacy.Enabled);
Assert.That(privacy.Enabled, Is.Null);

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
Assert.That(client.HttpMethodUsed(), Is.EqualTo(Method.PUT));
Expand All @@ -127,7 +127,7 @@ public void DisableWhoisPrivacy(long accountId, string domain, string expectedUr

Assert.Multiple(() =>
{
Assert.IsFalse(privacy.Enabled);
Assert.That(privacy.Enabled, Is.False);

Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl));
Assert.That(client.HttpMethodUsed(), Is.EqualTo(Method.DELETE));
Expand All @@ -151,7 +151,7 @@ public void RenewWhoisPrivacy(long accountId, string domain, string expectedUrl)
Assert.That(renewedDomain.WhoisPrivacyId, Is.EqualTo(999));
Assert.That(renewedDomain.State, Is.EqualTo("new"));
Assert.That(renewedDomain.ExpiresOn, Is.EqualTo(RenewalExpiresOn));
Assert.IsTrue(renewedDomain.Enabled);
Assert.That(renewedDomain.Enabled, Is.True);
Assert.That(renewedDomain.CreatedAt, Is.EqualTo(RenewalCreatedAt));
Assert.That(renewedDomain.UpdatedAt, Is.EqualTo(RenewalUpdatedAt));

Expand Down
Loading

0 comments on commit 9f35c25

Please sign in to comment.