public void _upToDate_info(ISoftware sw) { Assert.IsNotNull(sw); if (!sw.implementsSearchForNewer()) { Assert.Inconclusive("The check for up to date information was not performed, " + "because this class indicates that it does not implement the searchForNewer() method."); } var info = sw.info(); var newerInfo = sw.searchForNewer(); Assert.IsNotNull(newerInfo, "searchForNewer() returned null!"); int comp = string.Compare(info.newestVersion, newerInfo.newestVersion); var older = new Quartet(info.newestVersion); var newer = new Quartet(newerInfo.newestVersion); if (comp < 0 || older < newer) { Assert.Inconclusive( "Known newest version of " + info.Name + " is " + info.newestVersion + ", but the current newest version is " + newerInfo.newestVersion + "!"); } }
protected void _info(ISoftware sw) { Assert.IsNotNull(sw); var info = sw.info(); Assert.IsNotNull(info); // name must be set Assert.IsFalse(string.IsNullOrWhiteSpace(info.Name)); // at least one installation information instance should be present Assert.IsTrue((info.install32Bit != null) || (info.install64Bit != null)); // at least one regex should be present Assert.IsTrue(!string.IsNullOrWhiteSpace(info.match32Bit) || !string.IsNullOrWhiteSpace(info.match64Bit)); // 32 bit information should match Assert.AreEqual <bool>(info.install32Bit != null, !string.IsNullOrWhiteSpace(info.match32Bit)); // 64 bit information should match Assert.AreEqual <bool>(info.install64Bit != null, !string.IsNullOrWhiteSpace(info.match64Bit)); // checksums should always be present if (null != info.install32Bit) { Assert.IsTrue(info.install32Bit.hasChecksum()); } if (null != info.install64Bit) { Assert.IsTrue(info.install64Bit.hasChecksum()); } // check whether signature data has expired // Expiration is not an error though, because some people publish signed binaries that expire the day after the release. if (null != info.install32Bit && info.install32Bit.signature.containsData() && info.install32Bit.signature.hasExpired()) { Assert.Inconclusive("Signature data of 32 bit installer is past its expiration date!"); } if (null != info.install64Bit && info.install64Bit.signature.containsData() && info.install64Bit.signature.hasExpired()) { Assert.Inconclusive("Signature data of 64 bit installer is past its expiration date!"); } }