Пример #1
0
        public void HexNotationCtor()
        {
            var name = "Шестнадцатеричная";

            INotation notation = new HexNotation();

            Assert.IsNotNull(notation);
            Assert.AreEqual(name, notation.Name);
        }
Пример #2
0
        public void SetValueIntInput()
        {
            int       value    = 16;
            string    sValue   = "10";
            INotation notation = new HexNotation();

            notation.SetValue(value);

            Assert.AreEqual(value, notation.ValueInt);
            Assert.AreEqual(sValue, notation.ValueString);
        }
Пример #3
0
        public void SetValueTestStringInputWrong()
        {
            int       value    = 15;
            string    sValue   = "fx";
            INotation notation = new HexNotation();

            bool result = notation.SetValue(sValue);

            Assert.IsFalse(result);
            Assert.AreNotEqual(value, notation.ValueInt);
            Assert.AreNotEqual(sValue, notation.ValueString);
        }
Пример #4
0
        public void SetValueStringInput()
        {
            int       value    = 15;
            string    sValue   = "f";
            INotation notation = new HexNotation();

            bool result = notation.SetValue(sValue);

            Assert.IsTrue(result);
            Assert.AreEqual(value, notation.ValueInt);
            Assert.AreEqual(sValue, notation.ValueString);
        }