Esempio n. 1
0
        public async Task CreateShapeWithNamedArguments()
        {
            var     factory = _serviceProvider.GetService <IShapeFactory>();
            dynamic foo     = await factory.CreateAsync("Foo", ArgsUtility.Named(new { one = 1, two = "dos" }));

            Assert.Equal(1, foo.one);
            Assert.Equal("dos", foo.two);
        }
Esempio n. 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);
        }