public void ApplicationUpdate_VersionIsGreaterThan_ReturnsFalseWhenVersionFailsToParse() { // Arrange var update = new ApplicationUpdate { Version = "FailsToParse" }; // Act bool result = update.VersionIsGreaterThan(0); // Assert Assert.IsFalse(result); }
public void ApplicationUpdate_VersionIsGreaterThan_ReturnsFalse() { // Arrange var update = new ApplicationUpdate { Version = "1.0.0.0" }; // Act bool result = update.VersionIsGreaterThan(Application.ParseVersionNumber("1.0.0.1")); // Assert Assert.IsFalse(result); }
public void ApplicationUpdateService_GetApplicationUpdate_ReturnsObject() { // Arrange using (var artifacts = new ArtifactFolder()) { string path = artifacts.GetRandomFilePath(); var update = new ApplicationUpdate { Version = "1.2.3.4" }; using (FileStream stream = File.OpenWrite(path)) { new ApplicationUpdateSerializer().Serialize(stream, update); } var uri = new Uri(path); var service = new ApplicationUpdateService(null); // Act var result = service.GetApplicationUpdate(uri); // Assert Assert.IsNotNull(result); Assert.AreEqual("1.2.3.4", update.Version); } }