public void TestIronCompount()
        {
            ICompound iron = new RichCompound("Iron");

            Assert.That(iron.ToString(), Contains.Substring(" Fe"));
            Assert.That(iron.ToString(), Contains.Substring(" 2795"));
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // Non-adapted chemical compound

            Compound unknown = new Compound("Unknown");

            unknown.Display();

            // Adapted chemical compounds

            Compound water = new RichCompound("Water");

            water.Display();

            Compound benzene = new RichCompound("Benzene");

            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");

            ethanol.Display();

            // Wait for user

            Console.ReadKey();
        }
Exemplo n.º 3
0
        internal static void Main(string[] args)
        {
            ICompound water = new RichCompound("Water");
            water.Display();

            ICompound benzene = new RichCompound("Benzene");
            benzene.Display();

            ICompound ethanol = new RichCompound("Ethanol");
            ethanol.Display();
        }
        public static void Main()
        {
            ICompound water = new RichCompound("Water");
            water.Display();

            ICompound benzene = new RichCompound("Benzene");
            benzene.Display();

            ICompound ethanol = new RichCompound("Ethanol");
            ethanol.Display();
        }
Exemplo n.º 5
0
        internal static void Main(string[] args)
        {
            ICompound water = new RichCompound("Water");

            water.Display();

            ICompound benzene = new RichCompound("Benzene");

            benzene.Display();

            ICompound ethanol = new RichCompound("Ethanol");

            ethanol.Display();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            // Adapted chemical compounds
            ICompound water = new RichCompound("Water");

            water.Display();

            ICompound benzene = new RichCompound("Benzene");

            benzene.Display();

            ICompound ethanol = new RichCompound("Ethanol");

            ethanol.Display();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Compound unknown = new Compound("Unknown");
            unknown.Display();

            Compound water = new RichCompound("Water");
            water.Display();

            Compound benzene = new RichCompound("Benzene");
            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");
            ethanol.Display();

            Console.ReadKey();
        }
Exemplo n.º 8
0
        public static void Run()
        {
            Console.WriteLine("\n Adapter Real World Practice");
            Compound unknown = new Compound("Unknown");

            unknown.Display();

            Compound water = new RichCompound("Water");

            water.Display();

            Compound benzene = new RichCompound("Benzene");

            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");

            ethanol.Display();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Non-adapted chemical compound
            Compound unknown = new Compound("Unknown");
            unknown.Display();

            // Adapted chemical compounds
            Compound water = new RichCompound("Water");
            water.Display();

            Compound benzene = new RichCompound("Benzene");
            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");
            ethanol.Display();

            // Wait for user
            Console.ReadKey();
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            Compound unknown = new Compound("Unknown");

            unknown.Display();

            Compound water = new RichCompound("Water");

            water.Display();

            Compound benzene = new RichCompound("Benzene");

            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");

            ethanol.Display();

            Console.ReadKey();
        }
Exemplo n.º 11
0
        static void Main()
        {
            // Non-adapted chemical compound
            Compound unknown = new Compound("Unknown");

            unknown.Display();

            // Adapted chemical compounds
            Compound water = new RichCompound("Water");

            water.Display();

            Compound benzene = new RichCompound("Benzene");

            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");

            ethanol.Display();
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            //Non Adaped chemical compound
            Compound unkown = new Compound("unknown");

            unkown.Display();

            //Adapted chemical compounds
            Compound water = new RichCompound("WATER");

            water.Display();

            Compound benzene = new RichCompound("BENZENE");

            benzene.Display();

            Compound ethanol = new RichCompound("ETHANOL");

            ethanol.Display();
        }
Exemplo n.º 13
0
        public static void Run()
        {
            Console.WriteLine("This real-world code demonstrates the use of a legacy chemical databank. Chemical compound objects access the databank through an Adapter interface.");
            Compound unknown = new Compound("Unknown");

            unknown.Display();

            Compound water = new RichCompound("Water");

            water.Display();

            Compound benzene = new RichCompound("Benzene");

            benzene.Display();

            Compound ethanol = new RichCompound("Ethanol");

            ethanol.Display();

            /*
             * Compound: Unknown ------
             *
             * Compound: Water ------
             * Formula: H20
             * Weight : 18.015
             * Melting Pt: 0
             * Boiling Pt: 100
             *
             * Compound: Benzene ------
             * Formula: C6H6
             * Weight : 78.1134
             * Melting Pt: 5.5
             * Boiling Pt: 80.1
             *
             * Compound: Alcohol ------
             * Formula: C2H6O2
             * Weight : 46.0688
             * Melting Pt: -114.1
             * Boiling Pt: 78.3
             */
        }