Beispiel #1
0
        public void Attribute_Extraction()
        {
            AttributeDetail ai = ExtractAttribute(Subjects.One, "System.Reflection.AssemblyConfigurationAttribute");

            Assert.AreEqual(Status.Present, ai.Status);
            Assert.AreEqual("System.Reflection.AssemblyConfigurationAttribute(\"Test\")", ai.Declaration);
        }
        public void AppDomain_LoadTwoAssembliesSameName()
        {
            // Verify that we can load two different assemblies with the same strong name and examine them
            AttributeDetail ad1 = ExtractAttribute(Subjects.One, "System.Runtime.InteropServices.GuidAttribute");
            AttributeDetail ad2 = ExtractAttribute(Subjects.Two, "System.Runtime.InteropServices.GuidAttribute");

            Assert.AreNotEqual(ad1.Declaration, ad2.Declaration);
        }
        public void PostCategory(NewCategory category)
        {
            var newCategory = new Category();
            var detail      = new AttributeDetail();

            newCategory.CreatedBy   = category.CreatedBy;
            newCategory.Name        = category.Name;
            newCategory.Description = category.Description;
            newCategory.Icon        = category.Icon;
            newCategory.CreatedOn   = DateTime.Now;
            _categoryRepository.Add(newCategory);
            foreach (var attribute in category.Attributes)
            {
                detail.CategoryId  = newCategory.Id;
                detail.IsMandatory = attribute.IsMandatory;
                detail.Name        = attribute.Name;
                detail.Type        = attribute.Type;
                _attributeDetailRepository.Add(detail);
                detail = new AttributeDetail();
            }
        }
        public void SaveColumnview()
        {
            MRPEntities db = new MRPEntities();

            HttpContext.Current = DataHelper.SetUserAndPermission();
            ColumnViewController objUserController = new ColumnViewController();

            objUserController.ControllerContext = new ControllerContext(MockHelpers.FakeUrlHelper.FakeHttpContext(), new RouteData(), objUserController);
            objUserController.Url = MockHelpers.FakeUrlHelper.UrlHelper();
            List <AttributeDetail> lstattribute = new List <AttributeDetail>();
            AttributeDetail        objattribute = new AttributeDetail();

            objattribute.AttributeId   = "Actual";
            objattribute.AttributeType = "Actual";
            objattribute.ColumnOrder   = " ";
            lstattribute.Add(objattribute);
            var result = objUserController.SaveColumnView(lstattribute, string.Empty, false) as JsonResult;

            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name + " \n The Assert Value result : " + result.Data);
            Assert.IsNotNull(result.Data);
        }