예제 #1
0
        public void ZonesShouldBeUnique() {
            Func<dynamic> factory = () => new Shape();

            dynamic foo = new ZoneHolding(factory);
            var header = foo.Header;

            Assert.That(foo.Zones.Header, Is.EqualTo(header));
            Assert.That(foo.Zones["Header"], Is.EqualTo(header));
            Assert.That(foo.Header, Is.EqualTo(header));
        }
예제 #2
0
        public void NoneEmptyZonesShouldNotBeNull() {
            Func<dynamic> factory = () => new Shape();

            dynamic foo = new ZoneHolding(factory);

            Assert.That(foo.Header == null, Is.True);
            Assert.That(foo.Header != null, Is.False);

            foo.Header.Add("blah");

            Assert.That(foo.Header == null, Is.False);
            Assert.That(foo.Header != null, Is.True);

            Assert.That(foo.Header == Nil.Instance, Is.False);
            Assert.That(foo.Header != Nil.Instance, Is.True);
        }
예제 #3
0
        public void EmptyZonesShouldBeNull() {
            Func<dynamic> factory = () => new Shape();

            dynamic foo = new ZoneHolding(factory);

            Assert.That(foo.Header == 1, Is.False);
            Assert.That(foo.Header != 1, Is.True);

            dynamic header = foo.Header;

            Assert.That(header == null, Is.True);
            Assert.That(header != null, Is.False);

            Assert.That(header == Nil.Instance, Is.True);
            Assert.That(header != Nil.Instance, Is.False);
        }
예제 #4
0
 private dynamic CreateItemShape(string actualShapeType)
 {
     var zoneHolding = new ZoneHolding(() => _shapeFactory.Create("ContentZone", Arguments.Empty()));
     zoneHolding.Metadata.Type = actualShapeType;
     return zoneHolding;
 }
예제 #5
0
        public void ZonesMemberShouldCreateAZone() {
            Func<dynamic> factory = () => new Shape();

            dynamic foo = new ZoneHolding(factory);
            Assert.That(foo.Zones.Header, Is.InstanceOf<ZoneOnDemand>());
        }
예제 #6
0
        public void ZonesShouldReturn() {
            Func<dynamic> factory = () => new Shape();

            var foo = new ZoneHolding(factory);
            Assert.That(foo.Zones, Is.InstanceOf<Zones>());
        }