public void DistributorIsExemptFromPurchasingLimits_VN_WithValidTin()
        {
            var settings = new OrderingTestSettings("vi-VN", "webtest1");
            var ods      = OnlineDistributorHelper.GetOnlineDistributor(settings.Distributor, "VN", new List <string> {
                "VNID"
            });

            // Adding mandatory notes.
            //DistributorNotes = new List<DistributorNote_V01>()
            //    {
            //        new DistributorNote_V01()
            //            {
            //                CreationDate = DateTime.Now,
            //                EffectiveDate = DateTime.Now.AddDays(-1),
            //                Description = "Test note",
            //                NoteCode = "VNTRN"
            //            }
            //    };

            var             target    = new Ordering.Rules.PurchasingLimits.vi_VN.PurchasingLimitRules();
            MembershipUser  user      = Membership.GetUser("webtest1");
            GenericIdentity identity  = new GenericIdentity(user.UserName);
            RolePrincipal   principal = new RolePrincipal(identity);

            System.Threading.Thread.CurrentPrincipal = principal;
            HttpContext.Current.User = principal;
            HttpRuntime.Cache.Insert("DISTR_" + settings.Distributor, ods);

            var result = target.DistributorIsExemptFromPurchasingLimits(settings.Distributor);

            Assert.AreEqual(false, result, "Local distributor with valid Tin is exempt from limits");
        }
        public void DistributorIsExemptFromPurchasingLimits_VN_WithoutValidTin()
        {
            var             settings  = new OrderingTestSettings("vi-VN", "webtest1");
            var             ods       = OnlineDistributorHelper.GetOnlineDistributor(settings.Distributor, "VN", new List <string>());
            var             target    = new Ordering.Rules.PurchasingLimits.vi_VN.PurchasingLimitRules();
            MembershipUser  user      = Membership.GetUser("webtest1");
            GenericIdentity identity  = new GenericIdentity(user.UserName);
            RolePrincipal   principal = new RolePrincipal(identity);

            System.Threading.Thread.CurrentPrincipal = principal;
            HttpContext.Current.User = principal;
            HttpRuntime.Cache.Insert("DISTR_" + settings.Distributor, ods);
            var result = target.DistributorIsExemptFromPurchasingLimits(settings.Distributor);

            Assert.AreEqual(false, result, "Local distributor without valid Tin is not exempt from limits");
        }