コード例 #1
0
        public void CreateShapeWithNamedArguments()
        {
            var     factory = _serviceProvider.GetService <IShapeFactory>();
            dynamic foo     = factory.Create("Foo", ArgsUtility.Named(new { one = 1, two = "dos" }));

            Assert.Equal(1, foo.one);
            Assert.Equal("dos", foo.two);
        }
コード例 #2
0
        public void ShapeHasAttributesType()
        {
            var           factory  = _serviceProvider.GetService <IShapeFactory>();
            dynamic       foo      = factory.Create("Foo", ArgsUtility.Empty());
            ShapeMetadata metadata = foo.Metadata;

            Assert.Equal("Foo", metadata.Type);
        }
コード例 #3
0
        public void ShapeHasAttributesType()
        {
            var           factory  = _container.Resolve <IShapeFactory>();
            dynamic       foo      = factory.Create("Foo", ArgsUtility.Empty());
            ShapeMetadata metadata = foo.Metadata;

            Assert.That(metadata.Type, Is.EqualTo("Foo"));
        }
コード例 #4
0
        public void CreateShapeWithNamedArguments()
        {
            var     factory = _container.Resolve <IShapeFactory>();
            dynamic foo     = factory.Create("Foo", ArgsUtility.Named(new { one = 1, two = "dos" }));

            Assert.That(foo.one, Is.EqualTo(1));
            Assert.That(foo.two, Is.EqualTo("dos"));
        }
コード例 #5
0
 public void CreateShapeWithNamedArguments()
 {
     var factory = _container.Resolve <IShapeFactory>();
     var foo     = factory.Create("Foo", ArgsUtility.Named(new { one = 1, two = "dos" }));
 }