Exemple #1
0
        public void CalculateDiscount_NoDiscount()
        {
            int listLength    = 2;
            var deviceService = CreateDeviceService(listLength);
            var discount      = deviceService.CalculateDiscountAsync(
                MockDataFactory.GetListWithDuplicateDeviceIds(listLength));

            Assert.Equal(0.0m, discount.Result.discount);
        }
Exemple #2
0
        public void CalculateDiscount_DuplicateElement_Exception()
        {
            int listLength    = 2;
            var deviceService = CreateDeviceService(listLength);

            Assert.ThrowsAsync <AppException>(async() =>
            {
                await deviceService.CalculateDiscountAsync(MockDataFactory.GetListWithDuplicateDeviceIds(listLength));
            });
        }