private static void BadTarget() { var any = new CKAN.KSPVersion(null); var vshort = new CKAN.KSPVersion("0.23"); // We can't ask if something targets a non-real (short) version. any.Targets(vshort); }
public void TargetsString() { var any = new CKAN.KSPVersion(null); var vshort = new CKAN.KSPVersion("0.23"); var vlong = new CKAN.KSPVersion("0.23.5"); var slong = "0.23.5"; // Same tests as above, but now testing against a string. :) Assert.IsTrue(any.Targets(slong)); Assert.IsTrue(vshort.Targets(slong)); Assert.IsTrue(vlong.Targets(slong)); // And lets test some things that should fail. var too_big = new CKAN.KSPVersion("1.0.4"); Assert.IsFalse(vshort.Targets(too_big)); Assert.IsFalse(vlong.Targets(too_big)); }
public void Targets() { var any = new CKAN.KSPVersion(null); var vshort = new CKAN.KSPVersion("0.23"); var vlong = new CKAN.KSPVersion("0.23.5"); Assert.IsTrue(any.Targets(vlong)); Assert.IsTrue(vshort.Targets(vlong)); Assert.IsTrue(vlong.Targets(vlong)); Assert.That(BadTarget, Throws.Exception); }
public void MissingZeros() { var v1 = new CKAN.KSPVersion(".23.5"); Assert.IsInstanceOf<CKAN.KSPVersion>(v1); Assert.AreEqual("0.23.5", v1.Version()); var v0_23_5 = new CKAN.KSPVersion("0.23.5"); Assert.IsTrue(v1.Targets(v0_23_5)); // For when Squad makes what they think is a full release. ;) var v1_0_0 = new CKAN.KSPVersion("1.0.0"); Assert.IsTrue(v1_0_0 > v0_23_5); }
public void MissingZeros() { var v1 = new CKAN.KSPVersion(".23.5"); Assert.IsInstanceOf <CKAN.KSPVersion>(v1); Assert.AreEqual("0.23.5", v1.Version()); var v0_23_5 = new CKAN.KSPVersion("0.23.5"); Assert.IsTrue(v1.Targets(v0_23_5)); // For when Squad makes what they think is a full release. ;) var v1_0_0 = new CKAN.KSPVersion("1.0.0"); Assert.IsTrue(v1_0_0 > v0_23_5); }