Пример #1
0
        public void GetComplement_PositiveFloatingPointDecimal_Pass()
        {
            ComplementConverter conv      = new ComplementConverter();
            string         input          = "-200.73";
            int            radix          = 10;
            string         expectedValue  = "799.27";
            string         expectedPrefix = "(9)";
            BaseComplement complement     = conv.GetComplement(input, radix);

            Assert.AreEqual(expectedValue, complement.Value);
            Assert.AreEqual(expectedPrefix, complement.Prefix);
        }
Пример #2
0
        public void GetComplement_PositiveDecimalNumber_Pass()
        {
            ComplementConverter conv      = new ComplementConverter();
            string         input          = "200";
            int            radix          = 10;
            string         expectedValue  = "200.0";
            string         expectedPrefix = "(0)";
            BaseComplement complement     = conv.GetComplement(input, radix);

            Assert.AreEqual(expectedValue, complement.Value);
            Assert.AreEqual(expectedPrefix, complement.Prefix);
        }
Пример #3
0
        public void GetComplement_NegativeDecimalNumberWithZeroFloatingPart_Pass()
        {
            ComplementConverter conv      = new ComplementConverter();
            string         input          = "-200.0";
            int            radix          = 10;
            string         expectedValue  = "800.0";
            string         expectedPrefix = "(9)";
            BaseComplement complement     = conv.GetComplement(input, radix);

            Assert.AreEqual(expectedValue, complement.Value);
            Assert.AreEqual(expectedPrefix, complement.Prefix);
        }