Пример #1
0
        public void TestFormat_QuantitiesOnly()
        {
            FormatHelper fh = new FormatHelper();

            FormatString actual = fh.FormatInput("H2SO4");
            FormatString expected = new FormatString("H2SO4", new int[] { 0, 1, 0, 0, 1 });

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void TestFormat_Groups2()
        {
            FormatHelper fh = new FormatHelper();

            FormatString actual = fh.FormatInput("Co3(Fe(CN)6)2");
            FormatString expected = new FormatString("Co3(Fe(CN)6)2", "0010000000101");

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void TestFormat_ChargeOnly()
        {
            FormatHelper fh = new FormatHelper();

            FormatString actual = fh.FormatInput("H+");
            FormatString expected = new FormatString("H+", new int[] { 0, 2 });

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void TestFormat_Groups()
        {
            FormatHelper fh = new FormatHelper();

            FormatString actual = fh.FormatInput("(NH4)2SO4");
            FormatString expected = new FormatString("(NH4)2SO4", new int[] { 0,0,0,1,0,1,0,0,1 });

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void TestFormat_Charge()
        {
            FormatHelper fh = new FormatHelper();

            FormatString actual = fh.FormatInput("PO4-3");
            FormatString expected = new FormatString("PO43-", new int[] { 0, 0, 1, 2, 2 });

            Assert.AreEqual(expected, actual);
        }