Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            FlatWhite FW = new FlatWhite();
            Cortado   C  = new Cortado();
            Latte     L  = new Latte();
            SortKaffe SK = new SortKaffe();

            Console.WriteLine("");
            Console.WriteLine("en " + FW.Navn());
            Console.WriteLine("-----------------");
            Console.WriteLine("Styrke " + FW.Styrke());
            Console.WriteLine("Indeholer " + FW.MlMælk() + "Ml Mælk");
            Console.WriteLine("Koster " + FW.Pris() + " Dkk");

            Console.WriteLine("");
            Console.WriteLine("en " + C.Navn());
            Console.WriteLine("-----------------");
            Console.WriteLine("Styrke " + C.Styrke());
            Console.WriteLine("Indeholer " + C.MlMælk() + "Ml Mælk");
            Console.WriteLine("Koster " + C.Pris() + " Dkk");



            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");


            Cortado   c1  = new Cortado();
            Latte     l1  = new Latte();
            SortKaffe sk1 = new SortKaffe(5);
            FlatWhite fw1 = new FlatWhite(10);

            Console.WriteLine($"Cortado = Pris: {c1.Pris()}; Rabat: {c1.Rabat}; Styrke: {c1.Styrke()}; MlMælk: {c1.MlMælk()}");
            Console.WriteLine($"Latte = Pris: {l1.Pris()}; Rabat: {l1.Rabat}; Styrke: {l1.Styrke()}; MlMælk: {l1.MlMælk()}");
            Console.WriteLine($"SortKaffe = Pris: {sk1.Pris()}; Rabat: {sk1.Rabat}; Styrke: {sk1.Styrke()}");
            Console.WriteLine($"FlatWhite = Pris: {fw1.Pris()}; Rabat: {fw1.Rabat}; Styrke: {fw1.Styrke()}; MlMælk: {fw1.MlMælk()}");

            List <Kaffe> Kaffer = new List <Kaffe>()
            {
                c1, l1, sk1, fw1
            };
            List <Imælk> MælkeDrikke = new List <Imælk>()
            {
                c1, l1, fw1
            };

            foreach (Kaffe k in Kaffer)
            {
                if (k is Latte l)
                {
                    Console.WriteLine($"{l.GetType().Name} = pris: {l.Pris()}; mlMælk: {l.MlMælk()}");
                }
            }

            Console.ReadKey();
        }
        public void TestCortadoPris()
        {
            var cortadoKaffe = new Cortado();

            int pris = cortadoKaffe.Pris();

            Assert.AreEqual(25, pris);
        }
Beispiel #4
0
        public void CortadoTest()
        {
            Cortado cortado = new Cortado();

            int pris = cortado.Pris();

            Assert.AreEqual(25, pris);
        }
        public void TestMethodCortadoPris()
        {
            var cortado = new Cortado();

            int pris = cortado.Pris();

            Assert.AreEqual(25, pris);
        }
        public void TestAfCortadoPris()
        {
            //arrange
            var cortadoKaffe = new Cortado();
            //act
            int pris = cortadoKaffe.Pris();

            //assert
            Assert.AreEqual(25, pris);
        }
Beispiel #7
0
        public void CortadoPrisCheck()
        {
            //Arrange
            var Cortado = new Cortado();
            //Act
            int pris = Cortado.Pris();

            //Assert
            Assert.AreEqual(25, pris);
        }
Beispiel #8
0
        public void CortadoPrisTest()
        {
            // Arrange
            Cortado co = new Cortado();
            // Act
            int pris = co.Pris();

            // Assert
            Assert.AreEqual(25, pris);
        }
Beispiel #9
0
        public void PrisTestCortado()
        {
            //Arrange
            var cortado = new Cortado();
            //Act
            int pris = cortado.Pris();

            //Assert
            Assert.AreEqual(25, pris);
        }
        public void CortadoKaffeRabatTest()
        {
            // Arrange
            Cortado testCortado = new Cortado(25);

            // Act
            testCortado.Pris();

            // Assert
            Assert.Fail();
        }
Beispiel #11
0
        public void CortadoPrisTest()
        {
            //Arrange
            int pris = 25;

            //Act
            var cortado = new Cortado();

            //Assert
            Assert.AreEqual(cortado.Pris(), pris);
        }
        public void TestCortado_PrisNotNegative()
        {
            //arrange
            Cortado cortado = new Cortado();

            //act
            int actual = cortado.Pris();

            //assert
            Assert.IsTrue(actual >= 0);
        }
        public void TestCortadoPris()
        {
            // Arrange
            Cortado c = new Cortado();

            // Act
            int pris = c.Pris();

            // Assert
            Assert.AreEqual(25, pris);
        }
        public void TestCortado_PrisEquals25()
        {
            //arrange
            Cortado cortado = new Cortado();

            //act
            int expected = 25;
            int actual   = cortado.Pris();

            //assert
            Assert.AreEqual(expected, actual);
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Cortado   kaffe1 = new Cortado();
            Latte     kaffe2 = new Latte();
            SortKaffe kaffe3 = new SortKaffe();
            FlatWhite kaffe4 = new FlatWhite();

            //Ellers kan jeg også lave navne for kafferne også nedarve navnet på kafferne mht navnet i console.writeline

            Console.WriteLine("Cortado " + kaffe1.Pris() + "kr-; " + kaffe1.Styrke());
            Console.WriteLine("FlatWhite " + kaffe4.Pris() + "kr-;" + kaffe4.Styrke());
            Console.ReadLine();
        }
Beispiel #16
0
 public void CortadoPris()
 {
     Assert.IsTrue(_cortado.Pris() == 25);
 }