Exemplo n.º 1
0
 public void CreateNullRegionConfigurationTest()
 {
     Assert.Throws <ArgumentNullException>(
         delegate
     {
         RegionArranger regionArranger = new RegionArranger(null, new ElementConfiguration());
     });
 }
        public void CanArrangeTest()
        {
            RegionConfiguration methodRegionConfiguration = new RegionConfiguration();

            methodRegionConfiguration.Name = "Methods";
            ElementConfiguration methodConfiguration = new ElementConfiguration();

            methodConfiguration.ElementType = ElementType.Method;
            methodRegionConfiguration.Elements.Add(methodConfiguration);

            RegionConfiguration propertyRegionConfiguration = new RegionConfiguration();

            propertyRegionConfiguration.Name = "Properties";
            ElementConfiguration propertyConfiguration = new ElementConfiguration();

            propertyConfiguration.ElementType = ElementType.Property;
            propertyRegionConfiguration.Elements.Add(propertyConfiguration);

            ElementConfiguration parentConfiguration = new ElementConfiguration();

            parentConfiguration.ElementType = ElementType.Type;

            RegionArranger methodRegionArranger = new RegionArranger(
                methodRegionConfiguration, parentConfiguration);

            RegionArranger propertyRegionArranger = new RegionArranger(
                propertyRegionConfiguration, parentConfiguration);

            MethodElement method = new MethodElement();

            method.Name = "DoSomething";

            Assert.IsTrue(
                methodRegionArranger.CanArrange(method),
                "Expected region arranger to be able to arrange the element.");

            Assert.IsFalse(
                propertyRegionArranger.CanArrange(method),
                "Expected region arranger to not be able to arrange the element.");

            Assert.IsFalse(
                methodRegionArranger.CanArrange(null),
                "Expected region arranger to not be able to arrange a null element.");
        }
 public void CreateNullRegionConfigurationTest()
 {
     RegionArranger regionArranger = new RegionArranger(null, new ElementConfiguration());
 }
 public void CreateNullParentConfigurationTest()
 {
     RegionArranger regionArranger = new RegionArranger(new RegionConfiguration(), null);
 }
Exemplo n.º 5
0
 public void CreateNullRegionConfigurationTest()
 {
     Assert.Throws(typeof(ArgumentNullException), () => { RegionArranger regionArranger = new RegionArranger(null, new ElementConfiguration()); });
 }