diff --git a/src/dnsimple-test/ClientTest.cs b/src/dnsimple-test/ClientTest.cs index 6513859..25f0b37 100644 --- a/src/dnsimple-test/ClientTest.cs +++ b/src/dnsimple-test/ClientTest.cs @@ -27,19 +27,19 @@ public void CanSetTheBaseUrl() [Test] public void HasHttpService() { - Assert.IsInstanceOf(typeof(HttpService), _client.Http); + Assert.That(_client.Http, Is.InstanceOf()); } [Test] public void HasIdentityService() { - Assert.IsInstanceOf(typeof(IdentityService), _client.Identity); + Assert.That(_client.Identity, Is.InstanceOf()); } [Test] public void HasOAuthService() { - Assert.IsInstanceOf(typeof(OAuth2Service), _client.OAuth); + Assert.That(_client.OAuth, Is.InstanceOf()); } [Test] @@ -51,7 +51,7 @@ public void HasVersion() [Test] public void ReturnsInstanceOfTheIdentityService() { - Assert.IsInstanceOf(typeof(IdentityService), _client.Identity); + Assert.That(_client.Identity, Is.InstanceOf()); } [Test] diff --git a/src/dnsimple-test/Services/CertificatesTest.cs b/src/dnsimple-test/Services/CertificatesTest.cs index 4d84f45..2187de8 100644 --- a/src/dnsimple-test/Services/CertificatesTest.cs +++ b/src/dnsimple-test/Services/CertificatesTest.cs @@ -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"))); @@ -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"))); @@ -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)); }); @@ -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"))); @@ -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")); @@ -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"))); @@ -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")); diff --git a/src/dnsimple-test/Services/ContactsTest.cs b/src/dnsimple-test/Services/ContactsTest.cs index 85b22a3..b3cc9ef 100644 --- a/src/dnsimple-test/Services/ContactsTest.cs +++ b/src/dnsimple-test/Services/ContactsTest.cs @@ -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")); diff --git a/src/dnsimple-test/Services/DomainsCollaboratorsTest.cs b/src/dnsimple-test/Services/DomainsCollaboratorsTest.cs index af9e2ca..4fa86cc 100644 --- a/src/dnsimple-test/Services/DomainsCollaboratorsTest.cs +++ b/src/dnsimple-test/Services/DomainsCollaboratorsTest.cs @@ -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("existing-user@example.com")); - Assert.IsFalse(response.Data.First().Invitation); + Assert.That(response.Data.First().Invitation, Is.False); Assert.That(response.Data.Count, Is.EqualTo(2)); } @@ -73,7 +73,7 @@ public void AddCollaborator(string domainIdentifier, string expectedUrl) { Assert.That(collaborator.UserId, Is.EqualTo(999)); Assert.That(collaborator.UserEmail, Is.EqualTo("existing-user@example.com")); - Assert.IsFalse(collaborator.Invitation); + Assert.That(collaborator.Invitation, Is.False); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); }); @@ -107,8 +107,8 @@ public void InviteCollaborator(string domainIdentifier, string expectedUrl) Assert.Multiple(() => { Assert.That(collaborator.Data.UserEmail, Is.EqualTo("invited-user@example.com")); - 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)); }); diff --git a/src/dnsimple-test/Services/DomainsDnssecTest.cs b/src/dnsimple-test/Services/DomainsDnssecTest.cs index ebcb015..67b2bec 100644 --- a/src/dnsimple-test/Services/DomainsDnssecTest.cs +++ b/src/dnsimple-test/Services/DomainsDnssecTest.cs @@ -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)); @@ -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)); diff --git a/src/dnsimple-test/Services/DomainsPushesTest.cs b/src/dnsimple-test/Services/DomainsPushesTest.cs index 30c3712..1b13c0a 100644 --- a/src/dnsimple-test/Services/DomainsPushesTest.cs +++ b/src/dnsimple-test/Services/DomainsPushesTest.cs @@ -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)); diff --git a/src/dnsimple-test/Services/DomainsTest.cs b/src/dnsimple-test/Services/DomainsTest.cs index 5bb3d12..8465637 100644 --- a/src/dnsimple-test/Services/DomainsTest.cs +++ b/src/dnsimple-test/Services/DomainsTest.cs @@ -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"))); @@ -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"))); @@ -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)); diff --git a/src/dnsimple-test/Services/HttpTest.cs b/src/dnsimple-test/Services/HttpTest.cs index 7559325..b09f17c 100644 --- a/src/dnsimple-test/Services/HttpTest.cs +++ b/src/dnsimple-test/Services/HttpTest.cs @@ -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()); + } [Test] @@ -146,7 +146,7 @@ public void Resets() { _builder.Method(Method.HEAD); - Assert.IsNull(_builder.Reset().Request); + Assert.That(_builder.Reset().Request, Is.Null); } [Test] diff --git a/src/dnsimple-test/Services/RegistrarTest.cs b/src/dnsimple-test/Services/RegistrarTest.cs index 7c57f65..7f38e55 100644 --- a/src/dnsimple-test/Services/RegistrarTest.cs +++ b/src/dnsimple-test/Services/RegistrarTest.cs @@ -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)); }); @@ -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)); @@ -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)); @@ -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"))); @@ -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"))); }); diff --git a/src/dnsimple-test/Services/RegistrarWhoisPrivacyTest.cs b/src/dnsimple-test/Services/RegistrarWhoisPrivacyTest.cs index 171a6d2..495fb53 100644 --- a/src/dnsimple-test/Services/RegistrarWhoisPrivacyTest.cs +++ b/src/dnsimple-test/Services/RegistrarWhoisPrivacyTest.cs @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); diff --git a/src/dnsimple-test/Services/ServicesTest.cs b/src/dnsimple-test/Services/ServicesTest.cs index 05fae20..9a63671 100644 --- a/src/dnsimple-test/Services/ServicesTest.cs +++ b/src/dnsimple-test/Services/ServicesTest.cs @@ -43,12 +43,13 @@ public void ListServicesResponse() Assert.That(service.Name, Is.EqualTo("Service 1")); Assert.That(service.Sid, Is.EqualTo("service1")); Assert.That(service.Description, Is.EqualTo("First service example.")); - Assert.IsNull(service.SetupDescription); - Assert.IsFalse(service.RequiresSetup); - Assert.IsNull(service.DefaultSubdomain); + Assert.That(service.SetupDescription, Is.Null); + Assert.That(service.RequiresSetup, Is.False); + Assert.That(service.DefaultSubdomain, Is.Null); Assert.That(service.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(service.UpdatedAt, Is.EqualTo(UpdatedAt)); - Assert.IsEmpty(service.Settings); + Assert.That(service.Settings, Is.Empty); + Assert.That(services.Last().Settings.Count, Is.EqualTo(1)); Assert.That(serviceSetting.Name, Is.EqualTo("username")); @@ -56,7 +57,7 @@ public void ListServicesResponse() Assert.That(serviceSetting.Append, Is.EqualTo(".service2.com")); Assert.That(serviceSetting.Description, Is.EqualTo("Your Service2 username is used to connect services to your account.")); Assert.That(serviceSetting.Example, Is.EqualTo("username")); - Assert.IsFalse(serviceSetting.Password); + Assert.That(serviceSetting.Password, Is.False); }); } @@ -109,9 +110,9 @@ public void GetService(string serviceId, string expectedUrl) Assert.That(service.Name, Is.EqualTo("Service 1")); Assert.That(service.Sid, Is.EqualTo("service1")); Assert.That(service.Description, Is.EqualTo("First service example.")); - Assert.IsNull(service.SetupDescription); - Assert.IsTrue(service.RequiresSetup); - Assert.IsNull(service.DefaultSubdomain); + Assert.That(service.SetupDescription, Is.Null); + Assert.That(service.RequiresSetup, Is.True); + Assert.That(service.DefaultSubdomain, Is.Null); Assert.That(service.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(service.UpdatedAt, Is.EqualTo(UpdatedAt)); @@ -120,7 +121,7 @@ public void GetService(string serviceId, string expectedUrl) Assert.That(setting.Append, Is.EqualTo(".service1.com")); Assert.That(setting.Description, Is.EqualTo("Your Service 1 username is used to connect services to your account.")); Assert.That(setting.Example, Is.EqualTo("username")); - Assert.IsFalse(setting.Password); + Assert.That(setting.Password, Is.False); }); } } diff --git a/src/dnsimple-test/Services/TemplateRecordsTest.cs b/src/dnsimple-test/Services/TemplateRecordsTest.cs index 66ef5b8..7660f88 100644 --- a/src/dnsimple-test/Services/TemplateRecordsTest.cs +++ b/src/dnsimple-test/Services/TemplateRecordsTest.cs @@ -52,10 +52,10 @@ public void ListTemplateRecordsResponse() { Assert.That(record.Id, Is.EqualTo(296)); Assert.That(record.TemplateId, Is.EqualTo(268)); - Assert.IsEmpty(record.Name); + Assert.That(record.Name, Is.Empty); Assert.That(record.Content, Is.EqualTo("192.168.1.1")); Assert.That(record.Ttl, Is.EqualTo(3600)); - Assert.IsNull(record.Priority); + Assert.That(record.Priority, Is.Null); Assert.That(record.Type, Is.EqualTo("A")); Assert.That(record.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(record.UpdatedAt, Is.EqualTo(UpdatedAt)); diff --git a/src/dnsimple-test/Services/TldsTest.cs b/src/dnsimple-test/Services/TldsTest.cs index e489bf6..bb56f4c 100644 --- a/src/dnsimple-test/Services/TldsTest.cs +++ b/src/dnsimple-test/Services/TldsTest.cs @@ -36,13 +36,13 @@ public void TldsResponse() { Assert.That(tlds.First().Tld, Is.EqualTo("ac")); Assert.That(tlds.First().TldType, Is.EqualTo(2)); - Assert.IsFalse(tlds.First().WhoisPrivacy); - Assert.IsTrue(tlds.First().AutoRenewOnly); - Assert.IsFalse(tlds.First().Idn); + Assert.That(tlds.First().WhoisPrivacy, Is.False); + Assert.That(tlds.First().AutoRenewOnly, Is.True); + Assert.That(tlds.First().Idn, Is.False); Assert.That(tlds.First().MinimumRegistration, Is.EqualTo(1)); - Assert.IsTrue(tlds.First().RegistrationEnabled); - Assert.IsTrue(tlds.First().RenewalEnabled); - Assert.IsFalse(tlds.First().TransferEnabled); + Assert.That(tlds.First().RegistrationEnabled, Is.True); + Assert.That(tlds.First().RenewalEnabled, Is.True); + Assert.That(tlds.First().TransferEnabled, Is.False); }); } @@ -96,13 +96,13 @@ public void GetTld(string tldName, string expectedUrl) { Assert.That(tld.Tld, Is.EqualTo("com")); Assert.That(tld.TldType, Is.EqualTo(1)); - Assert.IsTrue(tld.WhoisPrivacy); - Assert.IsFalse(tld.AutoRenewOnly); - Assert.IsTrue(tld.Idn); + Assert.That(tld.WhoisPrivacy, Is.True); + Assert.That(tld.AutoRenewOnly, Is.False); + Assert.That(tld.Idn, Is.True); Assert.That(tld.MinimumRegistration, Is.EqualTo(1)); - Assert.IsTrue(tld.RegistrationEnabled); - Assert.IsTrue(tld.RenewalEnabled); - Assert.IsTrue(tld.TransferEnabled); + Assert.That(tld.RegistrationEnabled, Is.True); + Assert.That(tld.RenewalEnabled, Is.True); + Assert.That(tld.TransferEnabled, Is.True); Assert.That(tld.DnssecInterfaceType, Is.EqualTo("ds")); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); @@ -124,7 +124,7 @@ public void GetTldExtendedAttributes(string tldName, string expectedUrl) Assert.That(attribute.Name, Is.EqualTo("uk_legal_type")); Assert.That(attribute.Description, Is.EqualTo("Legal type of registrant contact")); - Assert.IsFalse(attribute.Required); + Assert.That(attribute.Required, Is.False); Assert.That(options.Count, Is.EqualTo(17)); Assert.That(options.First().Title, Is.EqualTo("UK Individual")); @@ -139,7 +139,7 @@ public void GetTldExtendedAttributes(string tldName, string expectedUrl) public void GetTldExtendedAttributesNoAttributes() { var client = new MockDnsimpleClient(GetTldExtendedAttributesNoAttributesFixture); - Assert.IsEmpty(client.Tlds.GetTldExtendedAttributes("boom").Data); + Assert.That(client.Tlds.GetTldExtendedAttributes("boom").Data, Is.Empty); } } } diff --git a/src/dnsimple-test/Services/ZoneRecordsTest.cs b/src/dnsimple-test/Services/ZoneRecordsTest.cs index f575e6f..0f60887 100644 --- a/src/dnsimple-test/Services/ZoneRecordsTest.cs +++ b/src/dnsimple-test/Services/ZoneRecordsTest.cs @@ -7,6 +7,7 @@ using dnsimple.Services; using dnsimple.Services.ListOptions; using NUnit.Framework; +using NUnit.Framework.Legacy; using RestSharp; using Pagination = dnsimple.Services.ListOptions.Pagination; @@ -67,15 +68,15 @@ public void ZoneRecordData() { Assert.That(record.Id, Is.EqualTo(1)); Assert.That(record.ZoneId, Is.EqualTo("example.com")); - Assert.IsNull(record.ParentId); + Assert.That(record.ParentId, Is.Null); Assert.That(record.Name, Is.EqualTo("")); Assert.That( record.Content, Is.EqualTo("ns1.dnsimple.com admin.dnsimple.com 1458642070 86400 7200 604800 300")); Assert.That(record.Ttl, Is.EqualTo(3600)); - Assert.IsNull(record.Priority); + Assert.That(record.Priority, Is.Null); Assert.That(record.Type, Is.EqualTo(ZoneRecordType.SOA)); - Assert.Contains("global", record.Regions); - Assert.IsTrue(record.SystemRecord); + Assert.That(record.Regions, Contains.Item("global")); + Assert.That(record.SystemRecord, Is.True); Assert.That(record.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(record.UpdatedAt, Is.EqualTo(UpdatedAt)); }); @@ -164,7 +165,7 @@ public void CreateZoneRecord(string fixture, long accountId, Assert.That(created.Content, Is.EqualTo("127.0.0.1")); Assert.That(created.Ttl, Is.EqualTo(600)); Assert.That(created.Type, Is.EqualTo(ZoneRecordType.A)); - Assert.Contains("global", created.Regions); + Assert.That(created.Regions, Contains.Item("global")); Assert.That(client.HttpMethodUsed(), Is.EqualTo(Method.POST)); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); @@ -185,15 +186,15 @@ public void GetZoneRecord(long accountId, string zoneId, long recordId, { Assert.That(record.Id, Is.EqualTo(recordId)); Assert.That(record.ZoneId, Is.EqualTo(zoneId)); - Assert.IsNull(record.ParentId); - Assert.IsEmpty(record.Name); + Assert.That(record.ParentId, Is.Null); + Assert.That(record.Name, Is.Empty); Assert.That(record.Content, Is.EqualTo("mxa.example.com")); Assert.That(record.Ttl, Is.EqualTo(600)); Assert.That(record.Priority, Is.EqualTo(10)); Assert.That(record.Type, Is.EqualTo(ZoneRecordType.MX)); - Assert.Contains("SV1", record.Regions); - Assert.Contains("IAD", record.Regions); - Assert.IsFalse(record.SystemRecord); + Assert.That(record.Regions, Contains.Item("SV1")); + Assert.That(record.Regions, Contains.Item("IAD")); + Assert.That(record.SystemRecord, Is.False); Assert.That(client.HttpMethodUsed(), Is.EqualTo(Method.GET)); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); @@ -223,14 +224,14 @@ public void UpdateZoneRecord(long accountId, string zoneId, { Assert.That(record.Id, Is.EqualTo(recordId)); Assert.That(record.ZoneId, Is.EqualTo(zoneId)); - Assert.IsNull(record.ParentId); - Assert.IsEmpty(record.Name); + Assert.That(record.ParentId, Is.Null); + Assert.That(record.Name, Is.Empty); Assert.That(record.Content, Is.EqualTo("mxb.example.com")); Assert.That(record.Ttl, Is.EqualTo(3600)); Assert.That(record.Priority, Is.EqualTo(20)); Assert.That(record.Type, Is.EqualTo(ZoneRecordType.MX)); - Assert.Contains("global", record.Regions); - Assert.IsFalse(record.SystemRecord); + Assert.That(record.Regions, Contains.Item("global")); + Assert.That(record.SystemRecord, Is.False); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); Assert.That(client.HttpMethodUsed(), Is.EqualTo(Method.PATCH)); @@ -270,7 +271,7 @@ public void CheckRecordDistribution(long accountId, string zoneId, long recordId Assert.Multiple(() => { - Assert.IsTrue(record.Distributed); + Assert.That(record.Distributed, Is.True); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); }); @@ -289,7 +290,7 @@ public void CheckRecordDistributionFailure(long accountId, string zoneId, long r Assert.Multiple(() => { - Assert.IsFalse(record.Distributed); + Assert.That(record.Distributed, Is.False); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); }); diff --git a/src/dnsimple-test/Services/ZonesTest.cs b/src/dnsimple-test/Services/ZonesTest.cs index e33d252..77fe9e7 100644 --- a/src/dnsimple-test/Services/ZonesTest.cs +++ b/src/dnsimple-test/Services/ZonesTest.cs @@ -55,7 +55,7 @@ public void Zones() Assert.That(zones.First().Id, Is.EqualTo(1)); Assert.That(zones.First().AccountId, Is.EqualTo(1010)); Assert.That(zones.First().Name, Is.EqualTo("example-alpha.com")); - Assert.IsFalse(zones.First().Reverse); + Assert.That(zones.First().Reverse, Is.False); Assert.That(zones.First().CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(zones.First().UpdatedAt, Is.EqualTo(UpdatedAt)); }); @@ -125,7 +125,7 @@ public void GetZone(long accountId, string zoneName, string expectedUrl) Assert.That(zone.Id, Is.EqualTo(1)); Assert.That(zone.AccountId, Is.EqualTo(accountId)); Assert.That(zone.Name, Is.EqualTo(zoneName)); - Assert.False(zone.Reverse); + Assert.That(zone.Reverse, Is.False); Assert.That(zone.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(zone.UpdatedAt, Is.EqualTo(UpdatedAt)); @@ -176,7 +176,7 @@ public void CheckZoneDistributionSuccess(long accountId, Assert.Multiple(() => { - Assert.IsTrue(zone.Data.Distributed); + Assert.That(zone.Data.Distributed, Is.True); Assert.That(client.RequestSentTo(), Is.EqualTo(expectedUrl)); }); @@ -192,7 +192,7 @@ public void CheckZoneDistributionFailure(long accountId, var zone = client.Zones.CheckZoneDistribution(accountId, zoneName); - Assert.IsFalse(zone.Data.Distributed); + Assert.That(zone.Data.Distributed, Is.False); } [Test] @@ -259,7 +259,7 @@ public void ActivateDns(long accountId, string zoneName) Assert.That(zone.Id, Is.EqualTo(1)); Assert.That(zone.AccountId, Is.EqualTo(1010)); Assert.That(zone.Name, Is.EqualTo("example.com")); - Assert.IsFalse(zone.Reverse); + Assert.That(zone.Reverse, Is.False); Assert.That(zone.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(zone.UpdatedAt, Is.EqualTo(UpdatedAt)); @@ -281,7 +281,7 @@ public void DeactivateDns(long accountId, string zoneName) Assert.That(zone.Id, Is.EqualTo(1)); Assert.That(zone.AccountId, Is.EqualTo(1010)); Assert.That(zone.Name, Is.EqualTo("example.com")); - Assert.IsFalse(zone.Reverse); + Assert.That(zone.Reverse, Is.False); Assert.That(zone.CreatedAt, Is.EqualTo(CreatedAt)); Assert.That(zone.UpdatedAt, Is.EqualTo(UpdatedAt));