Exemple #1
0
        public void TestGetProvidedServicesByEmplIdReturnTwoServices()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            var services             = _sut.GetProvidedServicesByEmplId(1, DateTime.Now, DateTime.Now);

            Assert.AreEqual(2, services.Count);
        }
Exemple #2
0
        public void TestProvidedServicesCrudVedInitializationDbProvidedServicesIsNotNull()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            var o = _sut._dbProvidedService;

            Assert.IsNotNull(o);
        }
Exemple #3
0
        public void TestGetProvidedServicesReturnTwoServices()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            var services             = _sut.GetProvidedServices(2);

            Assert.AreEqual(2, services.Count);
        }
Exemple #4
0
        public void TestGetPriceReturn0IfThereIsNoNegPriceAndNoServicesOnCase()
        {
            ProvidedServiceCrud _sut     = new ProvidedServiceCrud();
            decimal             expected = 0;
            decimal             actual   = _sut.GetPrice(1, 0);

            Assert.AreEqual(expected, actual);
        }
Exemple #5
0
        public void TestGetPriceReturnNegotiatedPrice4500()
        {
            ProvidedServiceCrud _sut     = new ProvidedServiceCrud();
            decimal             expected = 4500;
            decimal             actual   = _sut.GetPrice(1, 4500);

            Assert.AreEqual(expected, actual);
        }
Exemple #6
0
        public void TestUpdateProvidedServiceReturnOne()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            int expected             = 1;
            int actual = _sut.UpdateProvidedService(1, 2, 150, DateTime.Now, "Møde med kunden og kørsel");

            Assert.AreEqual(expected, actual);
        }
Exemple #7
0
        public void TestNewProvidedServiceReturnOne()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            int expected             = 1;
            int actual = _sut.NewProvidedService(1, DateTime.Now, 2, 200, "Møde", 1);

            Assert.AreEqual(expected, actual);
        }
Exemple #8
0
        public void TestDeleteProvidedServiceReturnOne()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            int expected             = 1;
            int actual = _sut.DeleteProvidedService(1);

            Assert.AreEqual(expected, actual);
        }
Exemple #9
0
        public void TestCalculatePriceReturn4750IfListOfServicesIsNotEmpty()
        {
            ProvidedServiceCrud _sut     = new ProvidedServiceCrud();
            decimal             expected = 4750;
            decimal             actual   = _sut.CalculatePrice(2);

            Assert.AreEqual(expected, actual);
        }
Exemple #10
0
        public void TestGetUnitPricesReturnTwoDecimal()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            int expected             = 2;
            int actual = _sut.GetUnitPrices().Count;

            Assert.AreEqual(expected, actual);
        }
Exemple #11
0
        public void TestGetPriceReturnCalculatedPrice4750()
        {
            ProvidedServiceCrud _sut     = new ProvidedServiceCrud();
            decimal             expected = 4750;
            decimal             actual   = _sut.GetPrice(2, 0);

            Assert.AreEqual(expected, actual);
        }
Exemple #12
0
        public void TestGetProvidedServicesByEmplIdReturnListOfServices()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            var  services            = _sut.GetProvidedServicesByEmplId(1, DateTime.Now, DateTime.Now);
            Type actual   = services[0].GetType();
            Type expected = typeof(ProvidedServiceM);

            Assert.AreEqual(expected, actual);
        }
Exemple #13
0
        public void TestCalculatePriceReturn0IfListOfServicesIsEmpty()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            // CaseId 1 returnerer en tom liste
            decimal expected = 0;
            decimal actual   = _sut.CalculatePrice(1);

            Assert.AreEqual(expected, actual);
        }
Exemple #14
0
        public void TestGetUnitPricesReturnListOfDecimal()
        {
            ProvidedServiceCrud _sut = new ProvidedServiceCrud();
            var  prices   = _sut.GetUnitPrices();
            Type actual   = prices[0].GetType();
            Type expected = typeof(decimal);

            Assert.AreEqual(expected, actual);
        }
Exemple #15
0
        public void TestCountWorkDoneReturn250AtSecondPlace()
        {
            ProvidedServiceCrud     _sut     = new ProvidedServiceCrud();
            List <ProvidedServiceM> services = new List <ProvidedServiceM>();

            services.Add(new ProvidedServiceM(2, 50));
            services.Add(new ProvidedServiceM(5, 200));

            int actual   = _sut.CountWorkDone(services)[1];
            int expected = 250;

            Assert.AreEqual(expected, actual);
        }
Exemple #16
0
        public void TestCountWorkReturnTwoEllementsInArray()
        {
            ProvidedServiceCrud     _sut     = new ProvidedServiceCrud();
            List <ProvidedServiceM> services = new List <ProvidedServiceM>();

            services.Add(new ProvidedServiceM(2, 50));
            services.Add(new ProvidedServiceM(5, 200));

            int actual   = _sut.CountWorkDone(services).Length;
            int expected = 2;

            Assert.AreEqual(expected, actual);
        }