예제 #1
0
        public void MemLoadIntTest()
        {
            OwnMath.memDel();

            //check memLoadInt()
            OwnMath.memAdd(25.4);
            Assert.AreEqual(25, OwnMath.memLoadInt());

            OwnMath.memAdd(0.5);
            Assert.AreEqual(26, OwnMath.memLoadInt());

            OwnMath.memDel();
        }
예제 #2
0
        public void MemDelTest()
        {
            OwnMath.memDel();

            //check memDel()
            OwnMath.memAdd(25);
            OwnMath.memDel();
            Assert.AreEqual(0, OwnMath.memLoad());

            OwnMath.memAdd(-25);
            OwnMath.memDel();
            Assert.AreEqual(0, OwnMath.memLoad());

            OwnMath.memDel();
        }
예제 #3
0
        public void MemAddTest()
        {
            //check memAdd(int a)
            OwnMath.memDel();
            OwnMath.memAdd(10);
            Assert.AreEqual(10, OwnMath.memLoad());
            OwnMath.memAdd(5);
            Assert.AreEqual(15, OwnMath.memLoad());

            //check memAdd(double a)
            OwnMath.memDel();
            OwnMath.memAdd(10.5);
            Assert.AreEqual(10.5, OwnMath.memLoad());
            OwnMath.memAdd(5.5);
            Assert.AreEqual(16, OwnMath.memLoad());

            OwnMath.memDel();
        }
예제 #4
0
        public void MemSubTest()
        {
            OwnMath.memDel();

            //check memSub(int a)
            OwnMath.memSub(10);
            Assert.AreEqual(-10, OwnMath.memLoad());
            OwnMath.memAdd(-5);
            Assert.AreEqual(-15, OwnMath.memLoad());

            //check memSub(double a)
            OwnMath.memDel();
            OwnMath.memSub(10.5);
            Assert.AreEqual(-10.5, OwnMath.memLoad());
            OwnMath.memSub(5.5);
            Assert.AreEqual(-16, OwnMath.memLoad());

            OwnMath.memDel();
        }
예제 #5
0
 private void ButtonMS_Click(object sender, EventArgs e)
 {
     OwnMath.memDel();
     OwnMath.memAdd(ParseNumber(UserInput.Text));
 }