Exemplo n.º 1
0
        public void Setup()
        {
            CurrentTime  = new DateTime(2012, 03, 29, 10, 24, 0, 0);
            ShopDateTime = new ShopDateTime();

            TimeSpan difference = ShopDateTime.FullShopDateTime - CurrentTime;

            ShopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);
        }
Exemplo n.º 2
0
        public void IsRolloverRestricted()
        {
            ShopDateTime pwnloanOriginalDate = new ShopDateTime();
            var          reason = string.Empty;
            string       pawnLoanCustomerNumber = string.Empty;
            string       currentCustomerNumber  = string.Empty;
            ShopDateTime currentdate            = new ShopDateTime();

            Assert.AreEqual(false, BusinessRulesProcedures.IsRolloverRestricted(CurrentSiteId, currentCustomerNumber, pawnLoanCustomerNumber, pwnloanOriginalDate.FullShopDateTime, currentdate.FullShopDateTime, ref reason));
        }
Exemplo n.º 3
0
        public void IsPickupRestricted()
        {
            var          reason                 = string.Empty;
            ShopDateTime currentshopdate        = new ShopDateTime();
            ShopDateTime pawnloanorigdate       = new ShopDateTime();
            string       pawnLoanCustomerNumber = string.Empty;
            string       currentCustomerNumber  = string.Empty;

            Assert.AreEqual(false, BusinessRulesProcedures.IsPickupRestricted(CurrentSiteId, currentCustomerNumber, pawnLoanCustomerNumber, pawnloanorigdate.FullShopDateTime, currentshopdate.FullShopDateTime, ref reason));
        }
Exemplo n.º 4
0
        public void GetValidPFIDateWithWaitdaysForBuy()
        {
            var currentTime  = new DateTime(2012, 03, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime transactionDate = new DateTime(2012, 03, 25, 0, 0, 0, 0);

            Assert.AreEqual("04/04/2012", BusinessRulesProcedures.GetValidPFIDateWithWaitdaysForBuy(transactionDate, CurrentSiteId));
        }
Exemplo n.º 5
0
        public void GetValidDueDateFromPFIDate()
        {
            var currentTime  = new DateTime(2012, 11, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime dueDate      = new DateTime(2012, 12, 25, 0, 0, 0, 0);
            DateTime expectedDate = new DateTime(2012, 11, 24, 0, 0, 0, 0);

            var pfiDate = BusinessRulesProcedures.GetValidDueDateFromPFIDate(dueDate, CurrentSiteId);

            Assert.Inconclusive(@"PFI wait days is being subtracted from due date.  Spreadsheet says PFI wait days should be 0, but 31 days are being subtracted.");
            Assert.AreEqual(string.Format("{0:MM/dd/yyyy}", expectedDate), pfiDate);
        }
Exemplo n.º 6
0
        public void IsRolloverRestricted()
        {
            var currentTime  = new DateTime(2012, 03, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime pawnloanOrigDate = new DateTime(2012, 03, 25, 0, 0, 0, 0);

            string reason = string.Empty;

            var isRestricted = BusinessRulesProcedures.IsRolloverRestricted(CurrentSiteId, "0", "0", pawnloanOrigDate, shopDateTime.FullShopDateTime, ref reason);

            Assert.AreEqual(false, isRestricted);
        }
Exemplo n.º 7
0
        public void GetValidDueDate()
        {
            var currentTime  = new DateTime(2012, 11, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime dueDate         = new DateTime(2012, 12, 25, 0, 0, 0, 0);
            DateTime expectedDueDate = new DateTime(2012, 12, 25, 0, 0, 0, 0);

            var adjustedDueDate = BusinessRulesProcedures.GetValidDueDate(dueDate, CurrentSiteId);

            //Due date non business day adjustment is not required.  Original due date will always be returned.
            Assert.AreEqual(string.Format("{0:MM/dd/yyyy}", expectedDueDate), adjustedDueDate);
        }
Exemplo n.º 8
0
        public void IsPickupRestricted()
        {
            var currentTime  = new DateTime(2012, 11, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime dueDate      = new DateTime(2012, 12, 25, 0, 0, 0, 0);
            DateTime expectedDate = new DateTime(2012, 12, 25, 0, 0, 0, 0);

            string reason = "";

            var isResticted = BusinessRulesProcedures.IsPickupRestricted(CurrentSiteId, "0", "0", dueDate, shopDateTime.FullShopDateTime, ref reason);

            Assert.AreEqual(false, isResticted);
            Assert.AreEqual("", reason);
        }
Exemplo n.º 9
0
        public void GetValidPFIDate()
        {
            var currentTime  = new DateTime(2012, 11, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime dueDate      = new DateTime(2012, 12, 25, 0, 0, 0, 0);
            DateTime expectedDate = new DateTime(2012, 12, 25, 0, 0, 0, 0);

            bool dateAdjusted = false;

            var pfiDate = BusinessRulesProcedures.GetValidPFIDate(dueDate, CurrentSiteId, ref dateAdjusted);

            Assert.Inconclusive(@"Doesn't look like the date will ever get adjusted because rules.xml has 'N' for CL_PWN_0093_DUEDATENBDADJTREQ");
            Assert.AreEqual(string.Format("{0:MM/dd/yyyy}", expectedDate), pfiDate);
            Assert.AreEqual(false, dateAdjusted);
        }
Exemplo n.º 10
0
        public void GetValidPFIDateWithWaitdays()
        {
            var currentTime  = new DateTime(2012, 11, 25, 10, 24, 0, 0);
            var shopDateTime = new ShopDateTime();

            TimeSpan difference = shopDateTime.FullShopDateTime - currentTime;

            shopDateTime.setOffsets(0, 0, 0, 0, 0, (int)-difference.TotalSeconds, 0);

            DateTime dueDate      = new DateTime(2012, 12, 25, 0, 0, 0, 0);
            DateTime expectedDate = new DateTime(2013, 1, 25, 0, 0, 0, 0);

            bool dateAdjusted = false;

            var pfiDate = BusinessRulesProcedures.GetValidPFIDateWithWaitdays(dueDate, CurrentSiteId, ref dateAdjusted);

            Assert.Inconclusive(@"Spreadsheet says '0' for PFI wait days, but 31 days are being added.");
            Assert.AreEqual(string.Format("{0:MM/dd/yyyy}", expectedDate), pfiDate);
            Assert.AreEqual(false, dateAdjusted);
        }