示例#1
0
        public void PrimitiveTypeTest()
        {
            // Arrange.
            const string TypeName = "TestType";
            var typeGuid = new Guid("{F8B1F4B6-E6D8-4E28-9E58-FFF7F4564262}");
            var type = new ServicePrimitiveType(TypeName, typeGuid, typeof(string));

            // Act / Assert.
            var typeInfo = new ServiceTypeInfo(type);

            Assert.AreEqual(TypeName, typeInfo.Name);
            Assert.AreEqual(typeGuid, typeInfo.Guid);
        }
示例#2
0
        /// <summary>
        /// Initializes static members of the <see cref="ServicePrimitiveTypes"/> class.
        /// </summary>
        static ServicePrimitiveTypes()
        {
            Int = new ServicePrimitiveType("Int", Guid.Parse("C0C9BB1A-7726-46A7-A7CE-BE11A451D7D2"), typeof(int));
            Double = new ServicePrimitiveType("Double", Guid.Parse("E189E84D-6716-4E93-A513-B42A7E0AB1AA"), typeof(double));
            String = new ServicePrimitiveType("String", Guid.Parse("781B52DE-5374-4052-934E-CFA95CAAA270"), typeof(string));
            Boolean = new ServicePrimitiveType("Boolean", Guid.Parse("12A2152F-278F-4A97-A654-D2CCBA718F2F"), typeof(bool));
            Decimal = new ServicePrimitiveType("Decimal", Guid.Parse("31456CA3-DCC6-4179-AF4B-6E0FA378783E"), typeof(decimal));
            DateTime = new ServicePrimitiveType("DateTime", Guid.Parse("B6B9E490-64C9-4CAA-B486-998A0000917C"), typeof(DateTime));
            Byte = new ServicePrimitiveType("Byte", Guid.Parse("E848A8D5-AC00-4D8D-88D3-CC923D408495"), typeof(byte));

            Types = new ReadOnlyCollection<ServicePrimitiveType>(new[] { Byte, Int, Double, String, Boolean, Decimal, DateTime });
            GuidMap = Types.ToDictionary(x => x.Guid);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceTypeInfo"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 public ServiceTypeInfo(ServicePrimitiveType type)
 {
     _nameExpression = () => type.DisplayName;
     _guidExpression = () => type.Guid;
 }