AjErl.Tests.Communication.TypeSerializerTests.CreateSerializerByFullNameAndProperties C# (CSharp) Method

CreateSerializerByFullNameAndProperties() private method

private CreateSerializerByFullNameAndProperties ( ) : void
return void
        public void CreateSerializerByFullNameAndProperties()
        {
            IList<PropertyType> properties = new List<PropertyType>();

            properties.Add(new PropertyType()
            {
                Name = "Id",
                Type = Types.Integer
            });

            properties.Add(new PropertyType()
            {
                Name = "FirstName",
                Type = Types.String
            });

            var serializer = new TypeSerializer("AjErl.Tests.Person", properties);

            Assert.AreEqual("AjErl.Tests.Person", serializer.TypeName);

            var props = serializer.Properties;

            Assert.IsNotNull(props);
            Assert.AreEqual(2, props.Count);

            Assert.AreEqual("Id", props[0].Name);
            Assert.AreEqual(Types.Integer, props[0].Type);
            Assert.IsNull(props[0].TypeName);

            Assert.AreEqual("FirstName", props[1].Name);
            Assert.AreEqual(Types.String, props[1].Type);
            Assert.IsNull(props[1].TypeName);
        }