Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        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);
        }