Ejemplo n.º 1
0
        public void TestProfitIsNotNull()
        {
            List <OfficePacks> officePacks = new List <OfficePacks>();

            officePacks.Add(
                new OfficePacks()
            {
                name        = "test1",
                vendor      = "test1",
                composition = 1,
                price       = 90
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test2",
                vendor      = "test2",
                composition = 3,
                price       = 50
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test3",
                vendor      = "test3",
                composition = 5,
                price       = 80
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test4",
                vendor      = "test4",
                composition = 10,
                price       = 40
            });
            OfficePacks office = OfficePacksMethodProfit.Method(officePacks);

            Assert.IsNotNull(office);
        }
Ejemplo n.º 2
0
        public void TestProfitError2()
        {
            List <OfficePacks> officePacks = new List <OfficePacks>();

            officePacks.Add(
                new OfficePacks()
            {
                name        = "test1",
                vendor      = "test1",
                composition = 1,
                price       = 90
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test2",
                vendor      = "test2",
                composition = 3,
                price       = 50
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test3",
                vendor      = "test3",
                composition = 5,
                price       = 80
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test4",
                vendor      = "test4",
                composition = 10,
                price       = 40
            });
            Assert.ThrowsException <Exception>(() => { OfficePacksMethodProfit.Method(null); });
        }