示例#1
0
        public JsonResult ValidateRepairVin(string vin, Guid shopGuid)
        {
            var lib    = new RepairLibrary(Db, User.Identity);
            var exists = lib.FindActiveRepairsByVinAndShop(vin, shopGuid);

            return(Json(new
            {
                Exists = exists
            }, JsonRequestBehavior.AllowGet));
        }
        public void RepairLibraryTest()
        {
            var user = new MockIdentity()
            {
                Name = "*****@*****.**",
                AuthenticationType = "Mock"
            };

            var context = new EntityDbContext();

            var lib = new RepairLibrary(context, user);

            Assert.IsTrue(lib != null);
        }
        public void RepairLibraryUnauthenticatedUserTest()
        {
            var user = new MockIdentity()
            {
                Name = "*****@*****.**",
                AuthenticationType = "Mock",
                IsAuthenticated    = false
            };

            var context = new EntityDbContext();

            var test = new RepairLibrary(context, user);

            Assert.IsFalse(test != null);
        }