Beispiel #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);
        }
Beispiel #2
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));
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }