예제 #1
0
        public void TestSetBuild()
        {
            MutableVersion v = new MutableVersion();

            v.Build = 100;

            Assert.AreEqual(100, v.Build);
        }
예제 #2
0
        public void TestSetRevision()
        {
            MutableVersion v = new MutableVersion();

            v.Revision = 100;

            Assert.AreEqual(100, v.Revision);
        }
예제 #3
0
        public void TestSetMinor()
        {
            MutableVersion v = new MutableVersion();

            v.Minor = 100;

            Assert.AreEqual(100, v.Minor);
        }
예제 #4
0
        public void TestConstructorWithAllParams()
        {
            MutableVersion v = new MutableVersion(1, 2, 3, 4);

            Assert.AreEqual(1, v.Major);
            Assert.AreEqual(2, v.Minor);
            Assert.AreEqual(3, v.Revision);
            Assert.AreEqual(4, v.Build);
        }
예제 #5
0
        public void TestConstructorWith1Param()
        {
            MutableVersion v = new MutableVersion(1);

            Assert.AreEqual(1, v.Major);
            Assert.AreEqual(0, v.Minor);
            Assert.AreEqual(0, v.Revision);
            Assert.AreEqual(0, v.Build);
        }
예제 #6
0
        public void TestDefaultConstructor()
        {
            MutableVersion v = new MutableVersion();

            Assert.AreEqual(0, v.Major);
            Assert.AreEqual(0, v.Minor);
            Assert.AreEqual(0, v.Revision);
            Assert.AreEqual(0, v.Build);
        }
예제 #7
0
        public void TestSetNegativeBuild()
        {
            MutableVersion v = new MutableVersion();

            Assert.That(() => {
                v.Build = -1;
            },
                        Throws.InstanceOf <ArgumentOutOfRangeException>()
                        );
        }
예제 #8
0
        public bool Equals(MutableVersion _p)
        {
            if ((object)_p == null)
            {
                return(false);
            }

            return(Major == _p.Major &&
                   Minor == _p.Minor &&
                   Revision == _p.Revision &&
                   Build == _p.Build);
        }
예제 #9
0
        /**********************************************************************************/

        public override bool Equals(object _o)
        {
            MutableVersion p = _o as MutableVersion;

            return(Equals(p));
        }
예제 #10
0
        public void TestToString()
        {
            MutableVersion v = new MutableVersion(11, 0, 1, 22234);

            Assert.AreEqual("11.0.1.22234", v.ToString());
        }