diff --git a/Solutions/VS15_amd64/Microsoft.Management.Infrastructure.Tests/Microsoft.Management.Infrastructure.Tests.csproj b/Solutions/VS15_amd64/Microsoft.Management.Infrastructure.Tests/Microsoft.Management.Infrastructure.Tests.csproj
index 0523960..c99c744 100644
--- a/Solutions/VS15_amd64/Microsoft.Management.Infrastructure.Tests/Microsoft.Management.Infrastructure.Tests.csproj
+++ b/Solutions/VS15_amd64/Microsoft.Management.Infrastructure.Tests/Microsoft.Management.Infrastructure.Tests.csproj
@@ -61,6 +61,11 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="packages.config" />
+    <None Include="UnitTests\TestData\dmtftypes.mof" />
+    <None Include="UnitTests\TestData\dscinstance.mof" />
+    <None Include="UnitTests\TestData\dscschema.mof" />
+    <None Include="UnitTests\TestData\mintinstance.mof" />
+    <None Include="UnitTests\TestData\mintschema.mof" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\AssemblyInfo.cs">
@@ -144,6 +149,18 @@
     <Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\SerializationTests\CimMofDeserializerTests.cs">
       <Link>SerializationTests\CimMofDeserializerTests.cs</Link>
     </Compile>
+    <Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\UnitTests\CimInstanceTest.cs">
+      <Link>UnitTests\CimInstanceTest.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\UnitTests\CimMofDeserializerTest.cs">
+      <Link>UnitTests\CimMofDeserializerTest.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\UnitTests\CimSessionTest.cs">
+      <Link>UnitTests\CimSessionTest.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\UnitTests\CimClassTest.cs">
+      <Link>UnitTests\CimClassTest.cs</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Properties\" />
diff --git a/test/Microsoft.Management.Infrastructure.Tests/Helpers/Assert.cs b/test/Microsoft.Management.Infrastructure.Tests/Helpers/Assert.cs
index fe8b1f2..b513350 100644
--- a/test/Microsoft.Management.Infrastructure.Tests/Helpers/Assert.cs
+++ b/test/Microsoft.Management.Infrastructure.Tests/Helpers/Assert.cs
@@ -1,12 +1,6 @@
 using System;
 using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xunit;
 using Xunit.Sdk;
-using Microsoft.Management.Infrastructure.Native;
 
 namespace MMI.Tests
 {
@@ -61,7 +55,7 @@ internal static void NotNull<T>(T actual) where T : class
         {
             Xunit.Assert.NotNull(actual);
         }
-        
+
         internal static void Null<T>(T actual) where T : class
         {
             Xunit.Assert.Null(actual);
diff --git a/test/Microsoft.Management.Infrastructure.Tests/Helpers/Helpers.cs b/test/Microsoft.Management.Infrastructure.Tests/Helpers/Helpers.cs
index 73eff19..60ed101 100644
--- a/test/Microsoft.Management.Infrastructure.Tests/Helpers/Helpers.cs
+++ b/test/Microsoft.Management.Infrastructure.Tests/Helpers/Helpers.cs
@@ -1,8 +1,6 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
+using System.IO;
 using System.Text;
-using System.Threading.Tasks;
 
 namespace MMI.Tests
 {
@@ -33,5 +31,35 @@ public static string GetStringRepresentationOfSerializedData(byte[] data)
             return Encoding.ASCII.GetString(data);
 #endif
         }
+
+        /// <summary>
+        /// convert string to byte[]
+        /// </summary>
+        /// <returns></returns>
+        public static byte[] GetBytesFromString(string str)
+        {
+            System.Text.UTF8Encoding encoding = new UTF8Encoding();
+            return encoding.GetBytes(str);
+        }
+
+        /// <summary>
+        /// Read file content to byte[]
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        public static byte[] GetBytesFromFile(string filePath)
+        {
+            using (FileStream fs = File.OpenRead(filePath))
+            {
+                byte[] bytes = new byte[fs.Length];
+                fs.Read(bytes, 0, Convert.ToInt32(fs.Length));
+                // FileStream.close method is not supported in .net core currently.
+#if !_LINUX
+                fs.Close();
+#else
+#endif
+                return bytes;
+            }
+        }
     }
 }
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimClassTest.cs b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimClassTest.cs
new file mode 100644
index 0000000..be1c7cf
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimClassTest.cs
@@ -0,0 +1,21 @@
+/*============================================================================
+* Copyright (C) Microsoft Corporation, All rights reserved.
+*=============================================================================
+*/
+
+namespace Microsoft.Management.Infrastructure.UnitTests
+{
+    using Microsoft.Management.Infrastructure;
+    using Microsoft.Management.Infrastructure.Native;
+    using System;
+    using MMI.Tests;
+    using Xunit;
+
+    public class CimClassTest
+    {
+        [TDDFact]
+        public void TODO()
+        {
+        }
+    }
+}
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimInstanceTest.cs b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimInstanceTest.cs
new file mode 100644
index 0000000..6f31fa7
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimInstanceTest.cs
@@ -0,0 +1,1270 @@
+/*============================================================================
+ * Copyright (C) Microsoft Corporation, All rights reserved.
+ *============================================================================
+ */
+
+namespace Microsoft.Management.Infrastructure.UnitTests
+{
+    using System.Collections;
+    using Microsoft.Management.Infrastructure;
+    using Microsoft.Management.Infrastructure.Native;
+    using Microsoft.Management.Infrastructure.Options;
+    using MMI.Tests;
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using Xunit;
+
+    public class CimInstanceTest
+    {
+        #region Test constructor
+        [Fact]
+        public void Constructor_ClassName_BasicTest()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            MMI.Tests.Assert.Equal("MyClassName", cimInstance.CimSystemProperties.ClassName, "emptyCimInstance.CimSystemProperties.ClassName should be round-tripped properly");
+            MMI.Tests.Assert.Null(cimInstance.CimSystemProperties.ServerName, "emptyCimInstance.CimSystemProperties.ServerName should be null");
+            MMI.Tests.Assert.Null(cimInstance.CimSystemProperties.Namespace, "emptyCimInstance.Namespace should be null");
+            MMI.Tests.Assert.Equal(0, cimInstance.CimInstanceProperties.Count, "emptyCimInstance.CimInstanceProperties.Count should be 0");
+            MMI.Tests.Assert.Equal(0, cimInstance.CimInstanceProperties.Count(), "emptyCimInstance.CimInstanceProperties should return no items");
+            MMI.Tests.Assert.NotNull(cimInstance.CimClass, "dynamicCimInstance.Class should be not null");
+        }
+
+        [Fact]
+        public void Constructor_ClassName_BasicTest2()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName", @"root\TestNamespace");
+            MMI.Tests.Assert.Equal("MyClassName", cimInstance.CimSystemProperties.ClassName, "emptyCimInstance.CimSystemProperties.ClassName should be round-tripped properly");
+            MMI.Tests.Assert.Null(cimInstance.CimSystemProperties.ServerName, "emptyCimInstance.CimSystemProperties.ServerName should be null");
+            MMI.Tests.Assert.Equal(@"root\TestNamespace", cimInstance.CimSystemProperties.Namespace, "cimInstance.Namespace should not be null");
+            MMI.Tests.Assert.Equal(0, cimInstance.CimInstanceProperties.Count, "emptyCimInstance.CimInstanceProperties.Count should be 0");
+            MMI.Tests.Assert.Equal(0, cimInstance.CimInstanceProperties.Count(), "emptyCimInstance.CimInstanceProperties should return no items");
+            MMI.Tests.Assert.NotNull(cimInstance.CimClass, "dynamicCimInstance.Class should not be null");
+        }
+
+        [Fact]
+        public void Constructor_ClassName_Null()
+        {
+            string className = (string)null;
+            ArgumentNullException ex = MMI.Tests.Assert.Throws<ArgumentNullException>(() => { return new CimInstance(className); });
+            MMI.Tests.Assert.Equal("className", ex.ParamName, "parameter name is not indicated correctly in returned ArgumentNullException");
+        }
+
+        [Fact]
+        public void Constructor_ClassName_Invalid()
+        {
+            string className = @"  I am an invalid classname according to Common\scx\naming.c: OSC_LegalName  ";
+            ArgumentOutOfRangeException ex = MMI.Tests.Assert.Throws<ArgumentOutOfRangeException>(() => { return new CimInstance(className); });
+            MMI.Tests.Assert.Equal("className", ex.ParamName, "parameter name is not indicated correctly in returned ArgumentOutOfRangeException");
+        }
+
+        [Fact]
+        public void Constructor_NameSpace_Valid()
+        {
+            string nameSpace = @"root/test";
+            CimInstance cimInstance = new CimInstance("MyClassName", nameSpace);
+            MMI.Tests.Assert.Equal("MyClassName", cimInstance.CimSystemProperties.ClassName, "emptyCimInstance.CimSystemProperties.ClassName should be round-tripped properly");
+            MMI.Tests.Assert.Equal(nameSpace, cimInstance.CimSystemProperties.Namespace, "cimInstance.Namespace should not be null");
+        }
+
+        [Fact]
+        public void Constructor_NameSpace_Invalid()
+        {
+            string nameSpace = @"  I am an invalid nameSpace according to Common\scx\naming.c: OSC_LegalName &(*&)*&(*#\/. ";
+            CimInstance cimInstance = new CimInstance("MyClassName", nameSpace);
+            MMI.Tests.Assert.Equal("MyClassName", cimInstance.CimSystemProperties.ClassName, "emptyCimInstance.CimSystemProperties.ClassName should be round-tripped properly");
+            MMI.Tests.Assert.Equal(nameSpace, cimInstance.CimSystemProperties.Namespace, "cimInstance.Namespace should not be null");
+        }
+
+        [Fact]
+        public void Constructor_Cloning_BasicTest()
+        {
+            CimInstance x = new CimInstance("MyClassName");
+            x.CimInstanceProperties.Add(CimProperty.Create("MyProperty", 123, CimType.SInt32, CimFlags.None));
+            CimInstance y = new CimInstance(x);
+
+            MMI.Tests.Assert.Equal(x.CimSystemProperties.ClassName, y.CimSystemProperties.ClassName, "clonedInstance.CimSystemProperties.ClassName is not correct");
+            MMI.Tests.Assert.Equal(x.CimSystemProperties.ServerName, y.CimSystemProperties.ServerName, "clonedInstance.CimSystemProperties.ServerName is not correct");
+            MMI.Tests.Assert.Equal(x.CimInstanceProperties.Count, y.CimInstanceProperties.Count, "clonedInstance.CimInstanceProperties.Count is not correct");
+
+            x.CimInstanceProperties["MyProperty"].Value = 456;
+            y.CimInstanceProperties["MyProperty"].Value = 789;
+            MMI.Tests.Assert.Equal(456, (int)(x.CimInstanceProperties["MyProperty"].Value), "setting originalInstance.CimInstanceProperties[...].Value doesn't affect the clonedInstance");
+            MMI.Tests.Assert.Equal(789, (int)(y.CimInstanceProperties["MyProperty"].Value), "setting clonedInstance.CimInstanceProperties[...].Value doesn't affect the originalInstance");
+        }
+
+        [Fact]
+        public void Constructor_Cloning_Null()
+        {
+            MMI.Tests.Assert.Throws<ArgumentNullException>(() => { return new CimInstance((CimInstance)null); });
+        }
+
+        [TDDFact]
+        public void Constructor_ClassDecl()
+        {
+            CimInstance x;
+            using (CimSession cimSession = CimSession.Create(null))
+            {
+                MMI.Tests.Assert.NotNull(cimSession, "cimSession should not be null");
+                IEnumerable<CimInstance> enumeratedInstances = cimSession.EnumerateInstances(@"root\cimv2", "Win32_Process");
+                MMI.Tests.Assert.NotNull(enumeratedInstances, "cimSession.EnumerateInstances returned something other than null");
+                x = enumeratedInstances.FirstOrDefault();
+                MMI.Tests.Assert.NotNull(x, "cimSession.EnumerateInstances returned some instances");
+            }
+
+            CimInstance y = new CimInstance(x.CimClass);
+            MMI.Tests.Assert.Equal(x.CimSystemProperties.ClassName, y.CimSystemProperties.ClassName, "clonedInstance.CimSystemProperties.ClassName is not correct");
+            MMI.Tests.Assert.Equal(x.CimSystemProperties.Namespace, y.CimSystemProperties.Namespace, "clonedInstance.CimSystemProperties.NameSpace is not correct");
+            MMI.Tests.Assert.Equal(x.CimSystemProperties.ServerName, y.CimSystemProperties.ServerName, "clonedInstance.CimSystemProperties.ServerName is not correct");
+            MMI.Tests.Assert.Equal(x.CimInstanceProperties.Count, y.CimInstanceProperties.Count, "clonedInstance.CimInstanceProperties.Count is not correct");
+        }
+
+        [TDDFact]
+        public void Constructor_ClassDecl_Null()
+        {
+            MMI.Tests.Assert.Throws<ArgumentNullException>(() => { return new CimInstance((CimClass)null); });
+        }
+        #endregion Test constructor
+
+        #region Test properties
+        [TDDFact]
+        public void Properties_CimClass()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            MI_Class classHandle;
+            MI_Result result = cimInstance.InstanceHandle.GetClass(out classHandle);
+            MMI.Tests.Assert.Equal(cimInstance.CimClass, new CimClass(classHandle), "property CimClass is not correct");
+        }
+
+        [Fact]
+        public void Properties_IsValueModified()
+        {
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt32, CimFlags.NotModified);
+            MMI.Tests.Assert.False(cimProperty.IsValueModified, "property should be marked as not modified (test point #10)");
+            cimProperty.Value = 456;
+            MMI.Tests.Assert.True(cimProperty.IsValueModified, "property should be marked as modified (test point #12)");
+            cimProperty.IsValueModified = false;
+            MMI.Tests.Assert.False(cimProperty.IsValueModified, "property should be marked as not modified (test point #14)");
+            cimProperty.IsValueModified = true;
+            MMI.Tests.Assert.True(cimProperty.IsValueModified, "property should be marked as modified (test point #16)");
+        }
+
+        [Fact]
+        public void Properties_Add()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt32, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+            MMI.Tests.Assert.Equal(cimInstance.CimInstanceProperties.Count, 1, "cimInstance.CimInstanceProperties.Count should be 1");
+            MMI.Tests.Assert.Equal(cimInstance.CimInstanceProperties.Count(), 1, "cimInstance.CimInstanceProperties.Count() should be 1");
+        }
+
+        [Fact]
+        public void Properties_Add_Name()
+        {
+            string propertyName = "MyPropertyName";
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create(propertyName, 123, CimType.SInt32, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.Equal(addedProperty.Name, propertyName, "addedProperty.Name is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_Flags()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt32, CimFlags.Key);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.Equal(addedProperty.Flags, CimFlags.Key | CimFlags.NotModified, "addedProperty.Flags is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_MismatchedValueAndType()
+        {
+            MMI.Tests.Assert.Throws<ArgumentException>(() =>
+            {
+                CimInstance cimInstance = new CimInstance("MyClassName");
+                CimProperty cimProperty = CimProperty.Create("MyPropertyName", "IamnotSInt32", CimType.SInt32, CimFlags.None);
+                cimInstance.CimInstanceProperties.Add(cimProperty);
+                return null;
+            });
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_Boolean()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", true, CimType.Boolean, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value should not be null");
+            MMI.Tests.Assert.True(addedProperty.Value is Boolean, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(true, (Boolean)(addedProperty.Value), "addedProperty.Value should be true");
+            MMI.Tests.Assert.Equal(CimType.Boolean, addedProperty.CimType, "addedProperty.CimType shoulbe be boolean");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_SInt8()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt8, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value should not be null");
+            MMI.Tests.Assert.True(addedProperty.Value is SByte, "addedProperty.Value.GetType() should be SByte");
+            MMI.Tests.Assert.Equal(123, (SByte)(addedProperty.Value), "addedProperty.Value should be 123");
+            MMI.Tests.Assert.Equal(CimType.SInt8, addedProperty.CimType, "addedProperty.CimType should be SInt8");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_SInt8_NegativeNumber()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", -123, CimType.SInt8, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value should not be null");
+            MMI.Tests.Assert.True(addedProperty.Value is SByte, "addedProperty.Value.GetType() should be SByte");
+            MMI.Tests.Assert.Equal((SByte)(-123), addedProperty.Value, "addedProperty.Value should be -123");
+            MMI.Tests.Assert.Equal(CimType.SInt8, addedProperty.CimType, "addedProperty.CimType should be SInt8");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_SInt8_Null()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", null, CimType.SInt8, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.Equal(addedProperty.CimType, CimType.SInt8, "addedProperty.CimType should be SInt8");
+            MMI.Tests.Assert.Null(addedProperty.Value, "addedProperty.Value should be null");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_UInt8()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.UInt8, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value should not be null");
+            MMI.Tests.Assert.True(addedProperty.Value is Byte, "addedProperty.Value.GetType() should be true");
+            MMI.Tests.Assert.Equal(123, (Byte)(addedProperty.Value), "addedProperty.Value should be 123");
+            MMI.Tests.Assert.Equal(CimType.UInt8, addedProperty.CimType, "addedProperty.CimType should be UInt8");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_SInt16()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt16, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value should not be null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int16, "addedProperty.Value.GetType() should be true");
+            MMI.Tests.Assert.Equal(123, (Int16)(addedProperty.Value), "addedProperty.Value should be Int16");
+            MMI.Tests.Assert.Equal(CimType.SInt16, addedProperty.CimType, "addedProperty.CimType should be SInt16");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_UInt16()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.UInt16, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value should not be null");
+            MMI.Tests.Assert.True(addedProperty.Value is UInt16, "addedProperty.Value.GetType() should be UInt16");
+            MMI.Tests.Assert.Equal(123, (UInt16)(addedProperty.Value), "addedProperty.Value should be 123");
+            MMI.Tests.Assert.Equal(CimType.UInt16, addedProperty.CimType, "addedProperty.CimType should be UInt16");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_SInt32()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt32, CimFlags.None);
+            MMI.Tests.Assert.Equal("MyPropertyName", cimProperty.Name, "CimProperty.Create correctly round-trips CimProperty.Name");
+            MMI.Tests.Assert.True(cimProperty.Value is Int32, "CimProperty.Create preserves the type of the value");
+            MMI.Tests.Assert.Equal(CimType.SInt32, cimProperty.CimType, "CimProperty.Create correctly round-trips CimProperty.CimType");
+            MMI.Tests.Assert.Equal(CimFlags.None, cimProperty.Flags, "CimProperty.Create correctly round-trips CimProperty.Flags");
+
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int32, "addedProperty.Value.GetType() should be Int32");
+            MMI.Tests.Assert.Equal(123, (Int32)(addedProperty.Value), "addedProperty.Value should be 123");
+            MMI.Tests.Assert.Equal(CimType.SInt32, addedProperty.CimType, "addedProperty.CimType should be SInt32");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_UInt32()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.UInt32, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is UInt32, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(CimType.UInt32, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_SInt64()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt64, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int64, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(123, (Int64)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt64, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_UInt64()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.UInt64, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is UInt64, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal((UInt64)(addedProperty.Value), (UInt64)123, "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(addedProperty.CimType, CimType.UInt64, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_Real32()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 1.23, CimType.Real32, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Single, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.True((Single)(addedProperty.Value) > 1.22, "addedProperty.Value is not correct (1)");
+            MMI.Tests.Assert.True((Single)(addedProperty.Value) < 1.24, "addedProperty.Value is not correct (2)");
+            MMI.Tests.Assert.Equal(CimType.Real32, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_Real64()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 1.23, CimType.Real64, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Double, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.True((Double)(addedProperty.Value) > 1.22, "addedProperty.Value is not correct (1)");
+            MMI.Tests.Assert.True((Double)(addedProperty.Value) < 1.24, "addedProperty.Value is not correct (2)");
+            MMI.Tests.Assert.Equal(CimType.Real64, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_Char16()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 'x', CimType.Char16, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Char, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal('x', (Char)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.Char16, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_DateTime_InTicks()
+        {
+            DateTime myDate = new DateTime(9990, DateTimeKind.Local);
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate.Ticks, ((DateTime)(addedProperty.Value)).Ticks, "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_DateTime()
+        {
+            DateTime myDate = new DateTime(2010, 09, 22, 7, 30, 0, DateTimeKind.Local);
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate, (DateTime)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_DateTime_MinValue()
+        {
+            DateTime myDate = DateTime.MinValue;
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate, (DateTime)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_DateTime_AlmostMinValue()
+        {
+            DateTime myDate = DateTime.MinValue.Add(TimeSpan.FromSeconds(1));
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate, (DateTime)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_DateTime_MaxValue()
+        {
+            DateTime myDate = DateTime.MaxValue;
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate, (DateTime)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_DateTime_AlmostMaxValue()
+        {
+            DateTime maxValidCimTimestampUtc = new DateTime(3155378975999999990, DateTimeKind.Utc);
+            DateTime maxValidCimTimestampLocal = TimeZoneInfo.ConvertTime(maxValidCimTimestampUtc, TimeZoneInfo.Local);
+
+            DateTime myDate = DateTime.MaxValue.Subtract(TimeSpan.FromSeconds(1));
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
+            DateTime value = (DateTime)addedProperty.Value;
+            MMI.Tests.Assert.Equal(maxValidCimTimestampLocal.Ticks, value.Ticks, "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_TimeSpan_InTicks()
+        {
+            TimeSpan myInterval = TimeSpan.FromTicks(9990);
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myInterval, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is TimeSpan, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval, (TimeSpan)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_TimeSpan()
+        {
+            TimeSpan myInterval = TimeSpan.FromSeconds(123);
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myInterval, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is TimeSpan, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval, (TimeSpan)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_TimeSpan_MaxValue()
+        {
+            TimeSpan myInterval = TimeSpan.MaxValue;
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", myInterval, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is TimeSpan, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval, (TimeSpan)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTime_TimeSpan_AlmostMaxValue()
+        {
+            TimeSpan almostMaxValue = TimeSpan.MaxValue.Subtract(TimeSpan.FromSeconds(1));
+            TimeSpan almostMaxValueWithFixedMilliseconds = new TimeSpan(
+                almostMaxValue.Days,
+                almostMaxValue.Hours,
+                almostMaxValue.Minutes,
+                almostMaxValue.Seconds,
+                almostMaxValue.Milliseconds);
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", almostMaxValueWithFixedMilliseconds, CimType.DateTime, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is TimeSpan, "addedProperty.Value.GetType() is not correct");
+            TimeSpan value = (TimeSpan)addedProperty.Value;
+            MMI.Tests.Assert.Equal(almostMaxValueWithFixedMilliseconds, value, "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is ont correct");
+        }
+
+        [Fact]
+        public void Properties_Add_ValueAndType_String()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", "foobar", CimType.String, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is String, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal("foobar", (String)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.String, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Instance()
+        {
+            CimInstance innerInstance = new CimInstance("MyInnerClass");
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", innerInstance, CimType.Instance, CimFlags.None);
+            MMI.Tests.Assert.Equal("MyPropertyName", cimProperty.Name, "CimProperty.Create correctly round-trips CimProperty.Name");
+            MMI.Tests.Assert.True(cimProperty.Value is CimInstance, "CimProperty.Create preserves the type of the value");
+            MMI.Tests.Assert.Equal(CimType.Instance, cimProperty.CimType, "CimProperty.Create correctly round-trips CimProperty.CimType");
+            MMI.Tests.Assert.Equal(CimFlags.None, cimProperty.Flags, "CimProperty.Create correctly round-trips CimProperty.Flags");
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is CimInstance, "addedProperty.Value.GetType() is not correct");
+            CimInstance roundTrippedInnerInstance = (CimInstance)addedProperty.Value;
+            MMI.Tests.Assert.Equal(roundTrippedInnerInstance.CimSystemProperties.ClassName, "MyInnerClass", "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.Instance, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Instance_InferredType()
+        {
+            CimInstance innerInstance = new CimInstance("MyInnerClass");
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", innerInstance, CimFlags.None);
+            MMI.Tests.Assert.Equal(cimProperty.Name, "MyPropertyName", "CimProperty.Create correctly round-trips CimProperty.Name");
+            MMI.Tests.Assert.True(cimProperty.Value is CimInstance, "CimProperty.Create preserves the type of the value");
+            MMI.Tests.Assert.Equal(CimType.Instance, cimProperty.CimType, "CimProperty.Create correctly round-trips CimProperty.CimType");
+            MMI.Tests.Assert.Equal(CimFlags.None, cimProperty.Flags, "CimProperty.Create correctly round-trips CimProperty.Flags");
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is CimInstance, "addedProperty.Value.GetType() is not correct");
+            CimInstance roundTrippedInnerInstance = (CimInstance)addedProperty.Value;
+            MMI.Tests.Assert.Equal("MyInnerClass", roundTrippedInnerInstance.CimSystemProperties.ClassName, "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.Instance, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Instance_RoundTrip()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            using (CimInstance embeddedInstance = new CimInstance("MyInnerClass"))
+            {
+                CimProperty cimProperty = CimProperty.Create("MyInnerProperty", 123, CimType.SInt32, CimFlags.None);
+                embeddedInstance.CimInstanceProperties.Add(cimProperty);
+
+                cimProperty = CimProperty.Create("MyEmbeddedObject", embeddedInstance, CimType.Instance, CimFlags.None);
+                cimInstance.CimInstanceProperties.Add(cimProperty);
+            }
+
+            using (CimInstance embeddedInstance2 = (CimInstance)cimInstance.CimInstanceProperties["MyEmbeddedObject"].Value)
+            {
+                MMI.Tests.Assert.Equal("MyInnerClass", embeddedInstance2.CimSystemProperties.ClassName, "addedProperty.Value is not correct");
+                MMI.Tests.Assert.Equal(123, (int)(embeddedInstance2.CimInstanceProperties["MyInnerProperty"].Value), "Initial value of $x.embeddedObject.innerProperty is not correct");
+
+                embeddedInstance2.CimInstanceProperties["MyInnerProperty"].Value = 456;
+                MMI.Tests.Assert.Equal(456, (int)(embeddedInstance2.CimInstanceProperties["MyInnerProperty"].Value), "Round-tripped value of $x.embeddedObject.innerProperty is not correct");
+            }
+
+            using (CimInstance embeddedInstance3 = (CimInstance)cimInstance.CimInstanceProperties["MyEmbeddedObject"].Value)
+            {
+                MMI.Tests.Assert.Equal("MyInnerClass", embeddedInstance3.CimSystemProperties.ClassName, "addedProperty.Value is not correct");
+                MMI.Tests.Assert.Equal(456, (int)(embeddedInstance3.CimInstanceProperties["MyInnerProperty"].Value), "Re-fetched value of $x.embeddedObject.innerProperty is not correct");
+            }
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Instance_DeepNesting()
+        {
+            CimInstance topLevel = new CimInstance("MyTopClass", "MyTopNamespace");
+            topLevel.CimInstanceProperties.Add(CimProperty.Create("TopLevelP2", 102, CimType.SInt32, CimFlags.None));
+            topLevel.CimInstanceProperties.Add(CimProperty.Create("TopLevelP3", 103, CimType.SInt32, CimFlags.None));
+            topLevel.CimInstanceProperties.Add(CimProperty.Create("TopLevelP4", 104, CimType.SInt32, CimFlags.None));
+
+            CimInstance midLevel = new CimInstance("MyMidClass", "MyMidNamespace");
+            midLevel.CimInstanceProperties.Add(CimProperty.Create("MidLevelP2", 202, CimType.SInt32, CimFlags.None));
+            midLevel.CimInstanceProperties.Add(CimProperty.Create("MidLevelP3", 203, CimType.SInt32, CimFlags.None));
+            midLevel.CimInstanceProperties.Add(CimProperty.Create("MidLevelP4", 204, CimType.SInt32, CimFlags.None));
+            midLevel.CimInstanceProperties.Add(CimProperty.Create("MidLevelP5", 205, CimType.SInt32, CimFlags.None));
+
+            CimInstance deepLevel = new CimInstance("MyDeepClass", "MyDeepNamespace");
+            deepLevel.CimInstanceProperties.Add(CimProperty.Create("DeepLevelP2", 302, CimType.SInt32, CimFlags.None));
+            deepLevel.CimInstanceProperties.Add(CimProperty.Create("DeepLevelP3", 303, CimType.SInt32, CimFlags.None));
+            deepLevel.CimInstanceProperties.Add(CimProperty.Create("DeepLevelP4", 304, CimType.SInt32, CimFlags.None));
+            deepLevel.CimInstanceProperties.Add(CimProperty.Create("DeepLevelP5", 305, CimType.SInt32, CimFlags.None));
+            deepLevel.CimInstanceProperties.Add(CimProperty.Create("DeepLevelP6", 306, CimType.SInt32, CimFlags.None));
+            deepLevel.CimInstanceProperties.Add(CimProperty.Create("DeepLevelP7", 307, CimType.SInt32, CimFlags.None));
+
+            midLevel.CimInstanceProperties.Add(CimProperty.Create("MyDeepLevel", deepLevel, CimType.Instance, CimFlags.None));
+            topLevel.CimInstanceProperties.Add(CimProperty.Create("MyMidLevel", midLevel, CimType.Instance, CimFlags.None));
+
+            MMI.Tests.Assert.Equal(4, topLevel.CimInstanceProperties.Count, "Top.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(102, (int)(topLevel.CimInstanceProperties["TopLevelP2"].Value), "Top.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(103, (int)(topLevel.CimInstanceProperties["TopLevelP3"].Value), "Top.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(104, (int)(topLevel.CimInstanceProperties["TopLevelP4"].Value), "Top.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(5, midLevel.CimInstanceProperties.Count, "Mid.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(202, (int)(midLevel.CimInstanceProperties["MidLevelP2"].Value), "Mid.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(203, (int)(midLevel.CimInstanceProperties["MidLevelP3"].Value), "Mid.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(204, (int)(midLevel.CimInstanceProperties["MidLevelP4"].Value), "Mid.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(205, (int)(midLevel.CimInstanceProperties["MidLevelP5"].Value), "Mid.Properties.P5 is not correct");
+            MMI.Tests.Assert.Equal(6, deepLevel.CimInstanceProperties.Count, "Deep.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(302, (int)(deepLevel.CimInstanceProperties["DeepLevelP2"].Value), "Deep.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(303, (int)(deepLevel.CimInstanceProperties["DeepLevelP3"].Value), "Deep.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(304, (int)(deepLevel.CimInstanceProperties["DeepLevelP4"].Value), "Deep.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(305, (int)(deepLevel.CimInstanceProperties["DeepLevelP5"].Value), "Deep.Properties.P5 is not correct");
+            MMI.Tests.Assert.Equal(306, (int)(deepLevel.CimInstanceProperties["DeepLevelP6"].Value), "Deep.Properties.P6 is not correct");
+            MMI.Tests.Assert.Equal(307, (int)(deepLevel.CimInstanceProperties["DeepLevelP7"].Value), "Deep.Properties.P7 is not correct");
+
+            CimInstance midLevel2 = (CimInstance)topLevel.CimInstanceProperties["MyMidLevel"].Value;
+            CimInstance deepLevel2 = (CimInstance)midLevel2.CimInstanceProperties["MyDeepLevel"].Value;
+            MMI.Tests.Assert.Equal(4, topLevel.CimInstanceProperties.Count, "Top.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(102, (int)(topLevel.CimInstanceProperties["TopLevelP2"].Value), "Top.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(103, (int)(topLevel.CimInstanceProperties["TopLevelP3"].Value), "Top.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(104, (int)(topLevel.CimInstanceProperties["TopLevelP4"].Value), "Top.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(5, midLevel2.CimInstanceProperties.Count, "Mid.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(202, (int)(midLevel2.CimInstanceProperties["MidLevelP2"].Value), "Mid.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(203, (int)(midLevel2.CimInstanceProperties["MidLevelP3"].Value), "Mid.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(204, (int)(midLevel2.CimInstanceProperties["MidLevelP4"].Value), "Mid.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(205, (int)(midLevel2.CimInstanceProperties["MidLevelP5"].Value), "Mid.Properties.P5 is not correct");
+            MMI.Tests.Assert.Equal(6, deepLevel2.CimInstanceProperties.Count, "Deep.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(302, (int)(deepLevel2.CimInstanceProperties["DeepLevelP2"].Value), "Deep.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(303, (int)(deepLevel2.CimInstanceProperties["DeepLevelP3"].Value), "Deep.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(304, (int)(deepLevel2.CimInstanceProperties["DeepLevelP4"].Value), "Deep.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(305, (int)(deepLevel2.CimInstanceProperties["DeepLevelP5"].Value), "Deep.Properties.P5 is not correct");
+            MMI.Tests.Assert.Equal(306, (int)(deepLevel2.CimInstanceProperties["DeepLevelP6"].Value), "Deep.Properties.P6 is not correct");
+            MMI.Tests.Assert.Equal(307, (int)(deepLevel2.CimInstanceProperties["DeepLevelP7"].Value), "Deep.Properties.P7 is not correct");
+
+            topLevel.Dispose();
+            midLevel2.Dispose();
+            MMI.Tests.Assert.Equal(6, deepLevel2.CimInstanceProperties.Count, "Deep.Properties.Count is not correct");
+            MMI.Tests.Assert.Equal(302, (int)(deepLevel2.CimInstanceProperties["DeepLevelP2"].Value), "Deep.Properties.P2 is not correct");
+            MMI.Tests.Assert.Equal(303, (int)(deepLevel2.CimInstanceProperties["DeepLevelP3"].Value), "Deep.Properties.P3 is not correct");
+            MMI.Tests.Assert.Equal(304, (int)(deepLevel2.CimInstanceProperties["DeepLevelP4"].Value), "Deep.Properties.P4 is not correct");
+            MMI.Tests.Assert.Equal(305, (int)(deepLevel2.CimInstanceProperties["DeepLevelP5"].Value), "Deep.Properties.P5 is not correct");
+            MMI.Tests.Assert.Equal(306, (int)(deepLevel2.CimInstanceProperties["DeepLevelP6"].Value), "Deep.Properties.P6 is not correct");
+            MMI.Tests.Assert.Equal(307, (int)(deepLevel2.CimInstanceProperties["DeepLevelP7"].Value), "Deep.Properties.P7 is not correct");
+
+            GC.KeepAlive(topLevel);
+            GC.KeepAlive(midLevel);
+            GC.KeepAlive(midLevel2);
+            GC.KeepAlive(deepLevel);
+            GC.KeepAlive(deepLevel2);
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Reference()
+        {
+            CimInstance innerReference = new CimInstance("MyInnerClass");
+
+            CimInstance cimReference = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", innerReference, CimType.Reference, CimFlags.None);
+            MMI.Tests.Assert.Equal("MyPropertyName", cimProperty.Name, "CimProperty.Create correctly round-trips CimProperty.Name");
+            MMI.Tests.Assert.True(cimProperty.Value is CimInstance, "CimProperty.Create preserves the type of the value");
+            MMI.Tests.Assert.Equal(CimType.Reference, cimProperty.CimType, "CimProperty.Create correctly round-trips CimProperty.CimType");
+            MMI.Tests.Assert.Equal(CimFlags.None, cimProperty.Flags, "CimProperty.Create correctly round-trips CimProperty.Flags");
+            cimReference.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimReference.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is CimInstance, "addedProperty.Value.GetType() is not correct");
+            CimInstance roundTrippedInnerReference = (CimInstance)addedProperty.Value;
+            MMI.Tests.Assert.Equal("MyInnerClass", roundTrippedInnerReference.CimSystemProperties.ClassName, "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.Reference, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_BooleanArray()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Boolean[] { true, false }, CimType.BooleanArray, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Boolean[], "addedProperty.Value.GetType() is not correct");
+            Boolean[] value = (Boolean[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.True(value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.False(value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.BooleanArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_SInt8Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new SByte[] { 123, 45 }, CimType.SInt8Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is SByte[], "addedProperty.Value.GetType() is not correct");
+            SByte[] value = (SByte[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(45, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt8Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_UInt8Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Byte[] { 123, 45 }, CimType.UInt8Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Byte[], "addedProperty.Value.GetType() is not correct");
+            Byte[] value = (Byte[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(45, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.UInt8Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_SInt16Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Int16[] { 123, 456 }, CimType.SInt16Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int16[], "addedProperty.Value.GetType() is not correct");
+            Int16[] value = (Int16[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt16Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_UInt16Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new UInt16[] { 123, 456 }, CimType.UInt16Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is UInt16[], "addedProperty.Value.GetType() is not correct");
+            UInt16[] value = (UInt16[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.UInt16Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_SInt32Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Int32[] { 123, 456 }, CimType.SInt32Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int32[], "addedProperty.Value.GetType() is not correct");
+            Int32[] value = (Int32[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt32Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_SInt32Array_InferredType()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Int32[] { 123, 456 }, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int32[], "addedProperty.Value.GetType() is not correct");
+            Int32[] value = (Int32[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt32Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_UInt32Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new UInt32[] { 123, 456 }, CimType.UInt32Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is UInt32[], "addedProperty.Value.GetType() is not correct");
+            UInt32[] value = (UInt32[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal((UInt32)123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal((UInt32)456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.UInt32Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_SInt64Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Int64[] { 123, 456 }, CimType.SInt64Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int64[], "addedProperty.Value.GetType() is not correct");
+            Int64[] value = (Int64[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt64Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_UInt64Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new UInt64[] { 123, 456 }, CimType.UInt64Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is UInt64[], "addedProperty.Value.GetType() is not correct");
+            UInt64[] value = (UInt64[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal((UInt64)123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal((UInt64)456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.UInt64Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Real32Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Single[] { 1.23f, 4.56f }, CimType.Real32Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Single[], "addedProperty.Value.GetType() is not correct");
+            Single[] value = (Single[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.True(value[0] > 1.22, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[0] < 1.24, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[1] > 4.55, "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.True(value[1] < 4.57, "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.Real32Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Real64Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Double[] { 1.23, 4.56 }, CimType.Real64Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Double[], "addedProperty.Value.GetType() is not correct");
+            Double[] value = (Double[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.True(value[0] > 1.22, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[0] < 1.24, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[1] > 4.55, "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.True(value[1] < 4.57, "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(addedProperty.CimType, CimType.Real64Array, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_Char16Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Char[] { 'x', 'y' }, CimType.Char16Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Char[], "addedProperty.Value.GetType() is not correct");
+            Char[] value = (Char[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal('x', value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal('y', value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.Char16Array, addedProperty.CimType, "addedProperty.CimType is  not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTimeArray_DateTime()
+        {
+            DateTime myDate1 = new DateTime(2010, 09, 22, 7, 30, 0, DateTimeKind.Local);
+            DateTime myDate2 = new DateTime(2010, 09, 23, 7, 30, 0, DateTimeKind.Local);
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new DateTime[] { myDate1, myDate2 }, CimType.DateTimeArray, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            IList value = (IList)addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Count, "addedProperty.Value.Count is not correct");
+            MMI.Tests.Assert.True(value[0] is DateTime, "addedProperty.Value[0].GetType() is not correct");
+            MMI.Tests.Assert.Equal((DateTime)value[0], myDate1, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[1] is DateTime, "addedProperty.Value[1].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate2, (DateTime)value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTimeArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTimeArray_TimeSpan()
+        {
+            TimeSpan myInterval1 = TimeSpan.FromSeconds(123);
+            TimeSpan myInterval2 = TimeSpan.FromSeconds(456);
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new TimeSpan[] { myInterval1, myInterval2 }, CimType.DateTimeArray, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            IList value = (IList)addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Count, "addedProperty.Value.Count is not correct");
+            MMI.Tests.Assert.True(value[0] is TimeSpan, "addedProperty.Value[0].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval1, (TimeSpan)value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[1] is TimeSpan, "addedProperty.Value[1].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval2, (TimeSpan)value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTimeArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTimeArray_Mixed()
+        {
+            DateTime myDate1 = new DateTime(2010, 09, 22, 7, 30, 0, DateTimeKind.Local);
+            TimeSpan myInterval2 = TimeSpan.FromSeconds(456);
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Object[] { myDate1, myInterval2 }, CimType.DateTimeArray, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            IList value = (IList)addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Count, "addedProperty.Value.Count is not correct");
+            MMI.Tests.Assert.True(value[0] is DateTime, "addedProperty.Value[0].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate1, (DateTime)value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[1] is TimeSpan, "addedProperty.Value[1].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval2, (TimeSpan)value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTimeArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_DateTimeArray_Mixed_InferredType()
+        {
+            DateTime myDate1 = new DateTime(2010, 09, 22, 7, 30, 0, DateTimeKind.Local);
+            TimeSpan myInterval2 = TimeSpan.FromSeconds(456);
+
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Object[] { myDate1, myInterval2 }, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            IList value = (IList)addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Count, "addedProperty.Value.Count is not correct");
+            MMI.Tests.Assert.True(value[0] is DateTime, "addedProperty.Value[0].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myDate1, (DateTime)value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.True(value[1] is TimeSpan, "addedProperty.Value[1].GetType() is not correct");
+            MMI.Tests.Assert.Equal(myInterval2, (TimeSpan)value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.DateTimeArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_StringArray()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new String[] { "foo", "bar" }, CimType.StringArray, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is String[], "addedProperty.Value.GetType() is not correct");
+            String[] value = (String[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal("foo", value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal("bar", value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.StringArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_InstanceArray()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+
+            CimInstance nestedInstance1 = new CimInstance("MyNestedInstance1");
+            CimInstance nestedInstance2 = new CimInstance("MyNestedInstance2");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new CimInstance[] { nestedInstance1, nestedInstance2 }, CimType.InstanceArray, CimFlags.None);
+            MMI.Tests.Assert.Equal("MyPropertyName", cimProperty.Name, "CimProperty.Create correctly round-trips CimProperty.Name");
+            MMI.Tests.Assert.True(cimProperty.Value is CimInstance[], "CimProperty.Create preserves the type of the value");
+            MMI.Tests.Assert.True(((CimInstance[])(cimProperty.Value))[0] != null, "CimProperty.Create preserves the nullness of the value");
+            MMI.Tests.Assert.Equal(CimType.InstanceArray, cimProperty.CimType, "CimProperty.Create correctly round-trips CimProperty.CimType");
+            MMI.Tests.Assert.Equal(CimFlags.None, cimProperty.Flags, "CimProperty.Create correctly round-trips CimProperty.Flags");
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is CimInstance[], "addedProperty.Value.GetType() is not correct");
+            CimInstance[] value = (CimInstance[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal("MyNestedInstance1", value[0].CimSystemProperties.ClassName, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal("MyNestedInstance2", value[1].CimSystemProperties.ClassName, "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.InstanceArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Add_ValueAndType_ReferenceArray()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+
+            CimInstance nestedInstance1 = new CimInstance("MyNestedInstance1");
+            CimInstance nestedInstance2 = new CimInstance("MyNestedInstance2");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new CimInstance[] { nestedInstance1, nestedInstance2 }, CimType.ReferenceArray, CimFlags.None);
+            MMI.Tests.Assert.Equal("MyPropertyName", cimProperty.Name, "CimProperty.Create correctly round-trips CimProperty.Name");
+            MMI.Tests.Assert.True(cimProperty.Value is CimInstance[], "CimProperty.Create preserves the type of the value");
+            MMI.Tests.Assert.True(((CimInstance[])(cimProperty.Value))[0] != null, "CimProperty.Create preserves the nullness of the value");
+            MMI.Tests.Assert.Equal(CimType.ReferenceArray, cimProperty.CimType, "CimProperty.Create correctly round-trips CimProperty.CimType");
+            MMI.Tests.Assert.Equal(CimFlags.None, cimProperty.Flags, "CimProperty.Create correctly round-trips CimProperty.Flags");
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is CimInstance[], "addedProperty.Value.GetType() is not correct");
+            CimInstance[] value = (CimInstance[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(2, value.Length, "addedProperty.Value.Length is not correct");
+            MMI.Tests.Assert.Equal("MyNestedInstance1", value[0].CimSystemProperties.ClassName, "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal("MyNestedInstance2", value[1].CimSystemProperties.ClassName, "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.ReferenceArray, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Set_ValueAndType_SInt32()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt32, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            addedProperty.Value = 456;
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int32, "addedProperty.Value.GetType() is not correct");
+            MMI.Tests.Assert.Equal(456, (Int32)(addedProperty.Value), "addedProperty.Value is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt32, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [TDDFact]
+        public void Properties_Set_ValueAndType_SInt32Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", null, CimType.SInt32Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            addedProperty.Value = new Int32[] { 123, 456 };
+            MMI.Tests.Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
+            MMI.Tests.Assert.True(addedProperty.Value is Int32[], "addedProperty.Value.GetType() is not correct");
+            Int32[] value = (Int32[])addedProperty.Value;
+            MMI.Tests.Assert.Equal(123, value[0], "addedProperty.Value[0] is not correct");
+            MMI.Tests.Assert.Equal(456, value[1], "addedProperty.Value[1] is not correct");
+            MMI.Tests.Assert.Equal(CimType.SInt32Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Set_NullValue_SInt32()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", 123, CimType.SInt32, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            addedProperty.Value = null;
+            MMI.Tests.Assert.Null(addedProperty.Value, "addedProperty.Value is not null");
+            MMI.Tests.Assert.Equal(CimType.SInt32, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Set_NullValue_SInt32Array()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty cimProperty = CimProperty.Create("MyPropertyName", new Int32[] { 123, 456 }, CimType.SInt32Array, CimFlags.None);
+            cimInstance.CimInstanceProperties.Add(cimProperty);
+
+            CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
+            addedProperty.Value = null;
+            MMI.Tests.Assert.Null(addedProperty.Value, "addedProperty.Value is not null");
+            MMI.Tests.Assert.Equal(CimType.SInt32Array, addedProperty.CimType, "addedProperty.CimType is not correct");
+        }
+
+        [Fact]
+        public void Properties_Indexer()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            cimInstance.CimInstanceProperties.Add(CimProperty.Create("My123property", 123, CimType.SInt32, CimFlags.None));
+            cimInstance.CimInstanceProperties.Add(CimProperty.Create("My456property", 456, CimType.SInt32, CimFlags.None));
+
+            CimProperty my123property = cimInstance.CimInstanceProperties["My123property"];
+            MMI.Tests.Assert.Equal("My123property", my123property.Name, "my123property.Name is not correct");
+            MMI.Tests.Assert.Equal(123, (Int32)my123property.Value, "my123property.Value is not correct");
+
+            CimProperty my456property = cimInstance.CimInstanceProperties["My456property"];
+            MMI.Tests.Assert.Equal("My456property", my456property.Name, "my456property.Name is not correct");
+            MMI.Tests.Assert.Equal(456, (Int32)my456property.Value, "my456property.Value is not correct");
+        }
+
+        [Fact]
+        public void Properties_Indexer_NotExistantName()
+        {
+            CimInstance cimInstance = new CimInstance("MyClassName");
+            CimProperty notExistantProperty = cimInstance.CimInstanceProperties["NotExistantPropertyName"];
+            MMI.Tests.Assert.Null(notExistantProperty, "notExistantProperty is not null");
+        }
+
+        [Fact]
+        public void GetCimType_FromDotNetType_Int32()
+        {
+            CimType cimType = CimConverter.GetCimType(typeof(Int32));
+            MMI.Tests.Assert.Equal(cimType, CimType.SInt32, "Got the right CimType back");
+        }
+
+        [Fact]
+        public void GetCimType_FromDotNetType_DateTime()
+        {
+            CimType cimType = CimConverter.GetCimType(typeof(DateTime));
+            MMI.Tests.Assert.Equal(CimType.DateTime, cimType, "Got the right CimType back");
+        }
+
+        [Fact]
+        public void GetCimType_FromDotNetType_CimInstance()
+        {
+            CimType cimType = CimConverter.GetCimType(typeof(CimInstance));
+            MMI.Tests.Assert.Equal(CimType.Instance, cimType, "Got the right CimType back");
+        }
+
+        [Fact]
+        public void GetCimType_FromDotNetType_Int32Array()
+        {
+            CimType cimType = CimConverter.GetCimType(typeof(Int32[]));
+            MMI.Tests.Assert.Equal(CimType.SInt32Array, cimType, "Got the right CimType back");
+        }
+
+        [Fact]
+        public void GetCimType_FromDotNetType_Int32List()
+        {
+            CimType cimType = CimConverter.GetCimType(typeof(List<Int32>));
+            MMI.Tests.Assert.Equal(CimType.SInt32Array, cimType, "Got the right CimType back");
+        }
+
+        [Fact]
+        public void GetDotNetType_FromCimType_SInt32()
+        {
+            Type dotNetType = CimConverter.GetDotNetType(CimType.SInt32);
+            MMI.Tests.Assert.Equal(typeof(Int32), dotNetType, "Got the right .NET type back");
+        }
+
+        [Fact]
+        public void GetDotNetType_FromCimType_SInt32Array()
+        {
+            Type dotNetType = CimConverter.GetDotNetType(CimType.SInt32Array);
+            MMI.Tests.Assert.Equal(typeof(Int32[]), dotNetType, "Got the right .NET type back");
+        }
+
+        [Fact]
+        public void GetDotNetType_FromCimType_Unknown()
+        {
+            Type dotNetType = CimConverter.GetDotNetType(CimType.Unknown);
+            MMI.Tests.Assert.Null(dotNetType, "should be null as expected");
+        }
+
+        [Fact]
+        public void GetDotNetType_FromCimType_DateTime()
+        {
+            Type dotNetType = CimConverter.GetDotNetType(CimType.DateTime);
+            MMI.Tests.Assert.Null(dotNetType, "should be null as expected");
+        }
+
+        [Fact]
+        public void GetDotNetType_FromCimType_DateTimeArray()
+        {
+            Type dotNetType = CimConverter.GetDotNetType(CimType.DateTimeArray);
+            MMI.Tests.Assert.Null(dotNetType, "should be null as expected");
+        }
+        #endregion Test properties
+    }
+}
\ No newline at end of file
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimMofDeserializerTest.cs b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimMofDeserializerTest.cs
new file mode 100644
index 0000000..4354ac2
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimMofDeserializerTest.cs
@@ -0,0 +1,595 @@
+/*============================================================================
+* Copyright (C) Microsoft Corporation, All rights reserved.
+*=============================================================================
+*/
+
+
+namespace Microsoft.Management.Infrastructure.UnitTests
+{
+    using Microsoft.Management.Infrastructure;
+    using Microsoft.Management.Infrastructure.Native;
+    using Microsoft.Management.Infrastructure.Serialization;
+    using MMI.Tests;
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using Xunit;
+
+    public class CimMofDeserializerTest : IDisposable
+    {
+        # region pre-test
+        CimMofDeserializer deserializer;
+
+        public CimMofDeserializerTest()
+        {
+            this.deserializer = CimMofDeserializer.Create();
+        }
+
+        public void Dispose()
+        {
+            if (this.deserializer != null)
+            {
+                this.deserializer.Dispose();
+            }
+        }
+        #endregion pre-test
+
+        #region Deserialization tests
+        [Fact]
+        public void Deserialization_CimClass_Basic0()
+        {
+            string classmof = "class A{string p;}; class B:A{uint8 p1;};";
+            uint offset = 0;
+            byte[] buffer = Helpers.GetBytesFromString(classmof);
+
+            IEnumerable<CimClass> classes = this.deserializer.DeserializeClasses(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(classes, "Class got deserialized");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset got increased");
+            MMI.Tests.Assert.Equal(2, classes.Count(), "class count should be 2");
+            IEnumerator<CimClass> ce = classes.GetEnumerator();
+            MMI.Tests.Assert.True(ce.MoveNext(), "movenext should be true");
+            {
+                MMI.Tests.Assert.Equal("A", ce.Current.CimSystemProperties.ClassName, "first class should be 'A'");
+                MMI.Tests.Assert.Equal(1, ce.Current.CimClassProperties.Count, "A class should have 1 property");
+                CimPropertyDeclaration p = ce.Current.CimClassProperties["p"];
+                MMI.Tests.Assert.NotNull(p, "A class property p should not be null");
+                MMI.Tests.Assert.Equal("p", p.Name, "property name should be p");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property should be String type");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext(), "movenext should be true");
+            {
+                MMI.Tests.Assert.Equal("B", ce.Current.CimSystemProperties.ClassName, "first class should be 'B'");
+                MMI.Tests.Assert.Equal(2, ce.Current.CimClassProperties.Count, "B class should have 2 properties");
+                CimPropertyDeclaration p1 = ce.Current.CimClassProperties["p1"];
+                MMI.Tests.Assert.NotNull(p1, "B class property p1 should not be null");
+                MMI.Tests.Assert.Equal("p1", p1.Name, "property name should be p");
+                MMI.Tests.Assert.Equal(CimType.UInt8, p1.CimType, "property should be Uint8 type");
+                MMI.Tests.Assert.Equal("A", ce.Current.CimSuperClass.CimSystemProperties.ClassName, "B should have parent class A");
+            }
+            MMI.Tests.Assert.False(ce.MoveNext(), "movenext should be false");
+        }
+
+        [Fact]
+        public void Deserialization_Instance_Basic()
+        {
+            string instancemof = "class A{string p;}; instance of A{p=\"a\";};instance of A{p=\"b\";};instance of A{p=\"c\";};instance of A{p=\"d\";};";
+
+            uint offset = 0;
+            byte[] buffer = Helpers.GetBytesFromString(instancemof);
+            IEnumerable<CimInstance> instances = this.deserializer.DeserializeInstances(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(instances, "Instance got deserialized");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset got increased");
+            MMI.Tests.Assert.Equal(4, instances.Count(), "instance count should be 4");
+            IEnumerator<CimInstance> ce = instances.GetEnumerator();
+            MMI.Tests.Assert.True(ce.MoveNext(), "movenext should be true");
+            {
+                MMI.Tests.Assert.Equal("A", ce.Current.CimSystemProperties.ClassName, "first class should be 'A'");
+                MMI.Tests.Assert.Equal(1, ce.Current.CimInstanceProperties.Count, "instance should have 1 property");
+                CimProperty p = ce.Current.CimInstanceProperties["p"];
+                MMI.Tests.Assert.NotNull(p, "property p should not be null");
+                MMI.Tests.Assert.Equal("p", p.Name, "property name is not p");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property should be String type");
+                MMI.Tests.Assert.Equal("a", p.Value.ToString(), "property value should be a");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext(), "movenext should be true");
+            {
+                MMI.Tests.Assert.Equal("A", ce.Current.CimSystemProperties.ClassName, "first class should be 'A'");
+                MMI.Tests.Assert.Equal(1, ce.Current.CimInstanceProperties.Count, "instance should have 1 property");
+                CimProperty p = ce.Current.CimInstanceProperties["p"];
+                MMI.Tests.Assert.NotNull(p, "property p should not be null");
+                MMI.Tests.Assert.Equal("p", p.Name, "property name is p");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property should be String type");
+                MMI.Tests.Assert.Equal("b", p.Value.ToString(), "property value should be b");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext(), "movenext should be true");
+            {
+                MMI.Tests.Assert.Equal("A", ce.Current.CimSystemProperties.ClassName, "first class should be 'A'");
+                MMI.Tests.Assert.Equal(1, ce.Current.CimInstanceProperties.Count, "instance should have 1 property");
+                CimProperty p = ce.Current.CimInstanceProperties["p"];
+                MMI.Tests.Assert.NotNull(p, "property p should not be null");
+                MMI.Tests.Assert.Equal("p", p.Name, "property name should be p");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property should be String type");
+                MMI.Tests.Assert.Equal("c", p.Value.ToString(), "property value should be  c");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext(), "movenext should be true");
+            {
+                MMI.Tests.Assert.Equal("A", ce.Current.CimSystemProperties.ClassName, "first class should be 'A'");
+                MMI.Tests.Assert.Equal(1, ce.Current.CimInstanceProperties.Count, "instance sould have 1 property");
+                CimProperty p = ce.Current.CimInstanceProperties["p"];
+                MMI.Tests.Assert.NotNull(p, "property p should not be null");
+                MMI.Tests.Assert.Equal("p", p.Name, "property name is p");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property should be String type");
+                MMI.Tests.Assert.Equal("d", p.Value.ToString(), "property value should be d");
+            }
+            MMI.Tests.Assert.False(ce.MoveNext(), "move next should be false.");
+
+        }
+
+        [Fact]
+        public void Deserialization_CimClass_NullBuffer()
+        {
+            MMI.Tests.Assert.Throws<ArgumentNullException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = null;
+                return this.deserializer.DeserializeClasses(buffer, ref offset);
+
+            });
+        }
+
+        [Fact]
+        public void Deserialization_CimClass_ToolSmallBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = new byte[1];
+                buffer[0] = byte.MinValue;
+                return this.deserializer.DeserializeClasses(buffer, ref offset);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_CimClass_JustLittleLargeBuffer()
+        {
+            MMI.Tests.Assert.Throws<ArgumentOutOfRangeException>(() =>
+            {
+                byte[] buffer = new byte[82];
+                uint offset = (uint)buffer.Length;
+                return this.deserializer.DeserializeClasses(buffer, ref offset);
+            });
+        }
+
+        // This test case maybe is invalid, will confirm with John and Ben, what is max size of Mof file we support
+        [Fact]
+        public void Deserialization_CimClass_ToolLargeBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                const int size = 50 * 1024 * 1024 + 1;
+                uint offset = 0;
+                byte[] buffer = new byte[size];
+                buffer[0] = byte.MinValue;
+                return this.deserializer.DeserializeClasses(buffer, ref offset);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_CimClass_GarbageBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                const int size = 1024;
+                uint offset = 0;
+                byte[] buffer = new byte[size];
+                buffer[0] = byte.MinValue;
+                return this.deserializer.DeserializeClasses(buffer, ref offset);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_CimClasse_InvalidMofBuffer()
+        {
+            MMI.Tests.Assert.Throws<ArgumentNullException>(() =>
+            {
+                const int size = 1024;
+                uint offset = 0;
+                byte[] buffer = new byte[size];
+                byte[] b2 = Helpers.GetBytesFromString("abcd");
+                b2.CopyTo(buffer, 0);
+                return this.deserializer.DeserializeClasses(buffer, ref offset);
+            });
+        }
+
+        [TDDFact]
+        public void Deserialization_CimClasse_NotNullOnClassNeededCallback()
+        {
+            MMI.Tests.Assert.Throws<NotImplementedException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = new byte[82];
+                CimMofDeserializer.OnClassNeeded onClassNeede = this.GetClass;
+                onClassNeede("Servername", @"root\TestNamespace", "MyClassName");
+                return this.deserializer.DeserializeClasses(buffer, ref offset, null, onClassNeede, null);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_CimClasse_NotNullGetIncludedFileContent()
+        {
+            MMI.Tests.Assert.Throws<NotImplementedException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = new byte[82];
+                CimMofDeserializer.GetIncludedFileContent getIncludedFileContent = this.GetFileContent;
+                getIncludedFileContent("I am a faked file");
+                return this.deserializer.DeserializeClasses(buffer, ref offset, null, null, getIncludedFileContent);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_Instance_NullBuffer()
+        {
+            MMI.Tests.Assert.Throws<ArgumentNullException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = null;
+                return this.deserializer.DeserializeInstances(buffer, ref offset);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_Instance_ToolSmallBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = new byte[1];
+                buffer[0] = byte.MinValue;
+                return this.deserializer.DeserializeInstances(buffer, ref offset);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_Instance_JustLittleLargeBuffer()
+        {
+            MMI.Tests.Assert.Throws<ArgumentOutOfRangeException>(() =>
+            {
+                byte[] buffer = new byte[82];
+                uint offset = (uint)buffer.Length;
+                return this.deserializer.DeserializeInstances(buffer, ref offset);
+            });
+        }
+
+        // This test case maybe is invalid, will confirm with John and Ben, what is max size of Mof file we support
+        [Fact]
+        public void Deserialization_Instance_ToolLargeBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                const int size = 50 * 1024 * 1024 + 1;
+                uint offset = 0;
+                byte[] buffer = new byte[size];
+                buffer[0] = byte.MinValue;
+                return this.deserializer.DeserializeInstances(buffer, ref offset);
+            });
+        }
+
+        [Fact]
+        public void Deserialization_Instance_GarbageBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                const int size = 50 * 1024 * 1024;
+                uint offset = 0;
+                byte[] buffer = new byte[size];
+                buffer[0] = byte.MinValue;
+                return this.deserializer.DeserializeInstances(buffer, ref offset);
+            });
+        }
+
+        [TDDFact]
+        public void Deserialization_Instance_InvalidMofBuffer()
+        {
+            MMI.Tests.Assert.Throws<CimException>(() =>
+            {
+                const int size = 50 * 1024 * 1024;
+                uint offset = 0;
+                byte[] buffer = new byte[size];
+                byte[] b2 = Helpers.GetBytesFromString("abcd");
+                b2.CopyTo(buffer, 0);
+                return this.deserializer.DeserializeInstances(buffer, ref offset);
+            });
+        }
+
+        [TDDFact]
+        public void Deserialization_Instance_NotNullOnClassNeededCallback()
+        {
+            string instancemof = "class A{string p;}; instance of A{p=\"a\";};instance of A{p=\"b\";};instance of A{p=\"c\";};instance of A{p=\"d\";};";
+            uint offset = 0;
+            byte[] buffer = Helpers.GetBytesFromString(instancemof);
+            CimMofDeserializer.OnClassNeeded onClassNeede = this.GetClass;
+            onClassNeede("Servername", @"root\TestNamespace", "MyClassName");
+            IEnumerable<CimInstance> instances = this.deserializer.DeserializeInstances(buffer, ref offset, null, onClassNeede, null);
+            MMI.Tests.Assert.NotNull(instances, "Instance got deserialized");
+        }
+
+        [Fact]
+        public void Deserialization_Instance_NotNullGetIncludedFileContent()
+        {
+            MMI.Tests.Assert.Throws<NotImplementedException>(() =>
+            {
+                uint offset = 0;
+                byte[] buffer = new byte[82];
+                CimMofDeserializer.GetIncludedFileContent getIncludedFileContent = this.GetFileContent;
+                getIncludedFileContent("I am a faked file");
+                return this.deserializer.DeserializeInstances(buffer, ref offset, null, null, getIncludedFileContent);
+            });
+        }
+        #endregion Deserialization tests
+
+        #region Deserialization an exteranl MOF file tests
+        [Fact]
+        public void Deserialization_CimClass_DSCMof()
+        {
+            string c1 = "MSFT_BaseCredential";
+            string c2 = "MSFT_WindowsCredential";
+            string c3 = "MSFT_BaseResourceConfiguration";
+            string c4 = "MSFT_FileDirectoryConfiguration";
+            string c5 = "MSFT_ConfigurationDocument";
+            uint offset = 0;
+#if !_LINUX
+            byte[] buffer = Helpers.GetBytesFromFile(@"..\..\TestData\dscschema.mof");
+#else
+            byte[] buffer = Helpers.GetBytesFromFile(@"test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscschema.mof");
+#endif
+            IEnumerable<CimClass> classes = deserializer.DeserializeClasses(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(classes, "class is null and is not deserialized.");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset is not correct");
+            MMI.Tests.Assert.Equal(5, classes.Count(), "class count is not 5");
+
+            IEnumerator<CimClass> ce = classes.GetEnumerator();
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal(ce.Current.CimSystemProperties.ClassName, c1,
+                    "first class is MSFT_BaseCredential");
+                MMI.Tests.Assert.Equal(2, ce.Current.CimClassProperties.Count, "class has 2 property");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal(ce.Current.CimSystemProperties.ClassName, c2,
+                    "first class is MSFT_WindowsCredential");
+                MMI.Tests.Assert.Equal(3, ce.Current.CimClassProperties.Count, "class has 3 property");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal(c3, ce.Current.CimSystemProperties.ClassName,
+                    "first class is MSFT_BaseResourceConfiguration");
+                MMI.Tests.Assert.Equal(4, ce.Current.CimClassProperties.Count, "class has 4 property");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal(c4, ce.Current.CimSystemProperties.ClassName,
+                    "first class is MSFT_FileDirectoryConfiguration");
+                MMI.Tests.Assert.Equal(17, ce.Current.CimClassProperties.Count, "class has 17 property");
+            }
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal(c5, ce.Current.CimSystemProperties.ClassName,
+                    "first class is MSFT_ConfigurationDocument");
+                MMI.Tests.Assert.Equal(4, ce.Current.CimClassProperties.Count, "class has 4 property");
+            }
+            MMI.Tests.Assert.True(!ce.MoveNext());
+        }
+
+        [TDDFact]
+        public void Deserialization_CimInstance_DSCMof()
+        {
+            uint offset = 0;
+#if !_LINUX
+            byte[] buffer = Helpers.GetBytesFromFile(@"..\..\TestData\dscinstance.mof");
+#else
+            byte[] buffer = Helpers.GetBytesFromFile(@"test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscinstance.mof");
+#endif
+            deserializer.SchemaValidationOption = MofDeserializerSchemaValidationOption.Strict;
+            IEnumerable<CimInstance> instances = deserializer.DeserializeInstances(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(instances, "Instance is null, it is not deserialized");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset is not correct");
+            MMI.Tests.Assert.Equal(2, instances.Count(), "instance count is 2");
+            IEnumerator<CimInstance> ie = instances.GetEnumerator();
+            MMI.Tests.Assert.True(ie.MoveNext());
+            {
+                MMI.Tests.Assert.Equal("MSFT_FileDirectoryConfiguration", ie.Current.CimSystemProperties.ClassName,
+                    "second instance is of class 'MSFT_FileDirectoryConfiguration'");
+                CimProperty p = ie.Current.CimInstanceProperties["ResourceId"];
+                MMI.Tests.Assert.NotNull(p, "property ResourceId is null");
+                MMI.Tests.Assert.Equal("ResourceId", p.Name, "property name is ResourceId");
+                MMI.Tests.Assert.Equal(p.CimType, CimType.String, "property ResourceId is of String type");
+                MMI.Tests.Assert.Equal("R1", p.Value.ToString(), "property value is AAA");
+
+                p = ie.Current.CimInstanceProperties["DestinationPath"];
+                MMI.Tests.Assert.NotNull(p, "property DestinationPath is null");
+                MMI.Tests.Assert.Equal("DestinationPath", p.Name, "property name is not DestinationPath");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property DestinationPath is of String type");
+                MMI.Tests.Assert.Equal(@"C:\Test", p.Value.ToString(), @"property value is C:\Test");
+
+                p = ie.Current.CimInstanceProperties["credential"];
+                MMI.Tests.Assert.NotNull(p, "property credential is not null");
+                MMI.Tests.Assert.Equal("credential", p.Name, "property name is credential");
+                MMI.Tests.Assert.Equal(CimType.Instance, p.CimType, "property credential is of String Instance");
+                CimInstance credentialvalue = p.Value as CimInstance;
+                MMI.Tests.Assert.NotNull(credentialvalue, "property credential value is not null");
+                MMI.Tests.Assert.Equal("MSFT_WindowsCredential", credentialvalue.CimSystemProperties.ClassName,
+                    "property credential is of type 'MSFT_WindowsCredential'");
+
+                p = credentialvalue.CimInstanceProperties["Password"];
+                MMI.Tests.Assert.NotNull(p, "property Password is null");
+                MMI.Tests.Assert.Equal("Password", p.Name, "property name is Password");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property Password is of String type");
+                MMI.Tests.Assert.Equal("BBB", p.Value.ToString(), "property value is BBB");
+            }
+            MMI.Tests.Assert.True(ie.MoveNext());
+            {
+                MMI.Tests.Assert.Equal("MSFT_ConfigurationDocument", ie.Current.CimSystemProperties.ClassName,
+                    "third instance is of class 'MSFT_ConfigurationDocument'");
+                CimProperty p = ie.Current.CimInstanceProperties["version"];
+                MMI.Tests.Assert.NotNull(p, "property version is null");
+                MMI.Tests.Assert.Equal("Version", p.Name, "property name is Version");
+                MMI.Tests.Assert.Equal(CimType.String, p.CimType, "property version is of String type");
+                MMI.Tests.Assert.Equal("1.0.0", p.Value.ToString(), "property value is 1.0.0");
+            }
+            MMI.Tests.Assert.True(!ie.MoveNext());
+        }
+
+        [TDDFact]
+        public void Deserialization_DMTFMof()
+        {
+            uint offset = 0;
+#if !_LINUX
+            byte[] buffer = GetFileContent(@"..\..\TestDataq\dmtftypes.mof");
+#else
+            byte[] buffer = Helpers.GetBytesFromFile(@"test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dmtftypes.mof");
+#endif
+            IEnumerable<CimClass> classes = deserializer.DeserializeClasses(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(classes, "class got deserialized");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset is not correct");
+            MMI.Tests.Assert.Equal(3, classes.Count(), "class count is 3");
+
+            IEnumerator<CimClass> ce = classes.GetEnumerator();
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal("TestClass_PropertyValues", ce.Current.CimSystemProperties.ClassName,
+                    "1st class is TestClass_PropertyValues");
+                MMI.Tests.Assert.Equal(1, ce.Current.CimClassProperties.Count, "class has 1 property");
+                MMI.Tests.Assert.Equal(CimType.UInt64, ce.Current.CimClassProperties["v_Key"].CimType);
+            }
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal(ce.Current.CimSystemProperties.ClassName, "TestClass_ForEmbedded",
+                    "2nd class is TestClass_ForEmbedded ");
+                MMI.Tests.Assert.Equal(ce.Current.CimClassProperties.Count, 1, "class has 1 property");
+                MMI.Tests.Assert.Equal(ce.Current.CimClassProperties["embeddedStringValue"].CimType, CimType.String);
+            }
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                var messag = "property type is not correct";
+                MMI.Tests.Assert.Equal("TestClass_AllDMTFTypes", ce.Current.CimSystemProperties.ClassName,
+                    "class name should be TestClass_AllDMTFTypes");
+                MMI.Tests.Assert.Equal(34, ce.Current.CimClassProperties.Count, "class has 34 properties");
+                MMI.Tests.Assert.Equal(CimType.Boolean, ce.Current.CimClassProperties["sbool"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt8, ce.Current.CimClassProperties["suint8"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt8, ce.Current.CimClassProperties["ssint8"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt16, ce.Current.CimClassProperties["sUINT16"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt16, ce.Current.CimClassProperties["ssint16"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt32, ce.Current.CimClassProperties["suint32"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt32, ce.Current.CimClassProperties["ssint32"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt64, ce.Current.CimClassProperties["suint64"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt64, ce.Current.CimClassProperties["ssint64"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Real32, ce.Current.CimClassProperties["srEal32"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Real64, ce.Current.CimClassProperties["sREAL64"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Char16, ce.Current.CimClassProperties["schar16"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.String, ce.Current.CimClassProperties["sstring"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.DateTime, ce.Current.CimClassProperties["sDATETIME"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.BooleanArray, ce.Current.CimClassProperties["a_bool"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt8Array, ce.Current.CimClassProperties["a_uint8"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt8Array, ce.Current.CimClassProperties["a_sint8"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt16Array, ce.Current.CimClassProperties["a_UINT16"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt16Array, ce.Current.CimClassProperties["a_sint16"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt32Array, ce.Current.CimClassProperties["a_uint32"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt32Array, ce.Current.CimClassProperties["a_sint32"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.UInt64Array, ce.Current.CimClassProperties["a_uint64"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.SInt64Array, ce.Current.CimClassProperties["a_sint64"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Real32Array, ce.Current.CimClassProperties["a_rEal32"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Real64Array, ce.Current.CimClassProperties["a_REAL64"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Char16Array, ce.Current.CimClassProperties["a_char16"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.StringArray, ce.Current.CimClassProperties["a_string"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.DateTimeArray, ce.Current.CimClassProperties["a_DATETIME"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Reference, ce.Current.CimClassProperties["embeddedReference"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Instance, ce.Current.CimClassProperties["embeddedinstance"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.InstanceArray, ce.Current.CimClassProperties["embeddedinstancearray"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.Instance, ce.Current.CimClassProperties["embeddedobject"].CimType, messag);
+                MMI.Tests.Assert.Equal(CimType.InstanceArray, ce.Current.CimClassProperties["embeddedobjectarray"].CimType, messag);
+                MMI.Tests.Assert.Equal(17, ce.Current.CimClassMethods.Count, "class has 17 methods");
+                CimMethodDeclaration decl = ce.Current.CimClassMethods[@"Win32ShutdownTracker"];
+                MMI.Tests.Assert.NotNull(decl, "CimClassMethods return a null.");
+                MMI.Tests.Assert.Null(decl.Parameters["MIReturn"]);
+                MMI.Tests.Assert.NotNull(decl.Parameters["Comment"]);
+                MMI.Tests.Assert.NotNull(decl.Parameters["Comment"].Qualifiers["in"]);
+                MMI.Tests.Assert.NotNull(decl.Parameters["Comment"].Qualifiers["MappingStrings"]);
+                MMI.Tests.Assert.Equal(decl.Parameters["Comment"].Qualifiers.Count, 2);
+                // reactive for debug 
+                // Console.WriteLine(@"decl name: {0}", decl.Name);           
+                //foreach (CimMethodDeclaration d in ce.Current.CimClassMethods)
+                //{
+                //    Console.WriteLine(@"method name {0}, qualifer count {1}", d.Name, d.Qualifiers.Count);
+                //    Console.WriteLine(@"return type is {0}", d.ReturnType.ToString());
+                //    foreach (CimQualifier cq in d.Qualifiers)
+                //    {
+                //        Console.WriteLine(@"q name {0}, q flag {1}, q type {2}", cq.Name, cq.Flags, cq.CimType.ToString());
+                //    }
+                //}
+            }
+            MMI.Tests.Assert.True(!ce.MoveNext());
+        }
+
+        [Fact]
+        public void Deserialization_CimClass_MintMof()
+        {
+            uint offset = 0;
+#if !_LINUX
+            byte[] buffer = GetFileContent(@"..\..\TestDataq\mintschema.mof");
+#else
+            byte[] buffer = Helpers.GetBytesFromFile(@"test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintschema.mof");
+#endif
+            IEnumerable<CimClass> classes = deserializer.DeserializeClasses(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(classes, "class is null and is not deserialized");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset is not currect");
+            MMI.Tests.Assert.Equal(40, classes.Count(), "class count is 40");
+            IEnumerator<CimClass> ce = classes.GetEnumerator();
+            MMI.Tests.Assert.True(ce.MoveNext());
+            {
+                MMI.Tests.Assert.Equal("MSFT_Expression", ce.Current.CimSystemProperties.ClassName,
+                    "first class is not MSFT_BaseCredential");
+            }
+        }
+
+        [TDDFact]
+        public void Deserialization_CimInstance_MintMof()
+        {
+            uint offset = 0;
+#if !_LINUX
+            byte[] buffer = GetFileContent(@"..\..\TestDataq\mintinstance.mof");
+#else
+            byte[] buffer = Helpers.GetBytesFromFile(@"test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintinstance.mof");
+#endif
+            deserializer.SchemaValidationOption = MofDeserializerSchemaValidationOption.Ignore;
+
+            IEnumerable<CimInstance> instances = deserializer.DeserializeInstances(buffer, ref offset);
+            MMI.Tests.Assert.NotNull(instances, "Instance is null and is not deserialized");
+            MMI.Tests.Assert.Equal((uint)buffer.Length, offset, "Offset is not currect");
+            MMI.Tests.Assert.Equal(1, instances.Count(), "instance count is 1");
+
+            IEnumerator<CimInstance> ie = instances.GetEnumerator();
+            MMI.Tests.Assert.True(ie.MoveNext());
+            {
+                MMI.Tests.Assert.Equal("MSFT_ExpressionLambda", ie.Current.CimSystemProperties.ClassName,
+                    "first instance class is 'MSFT_ExpressionLambda'");
+            }
+            MMI.Tests.Assert.False(ie.MoveNext());
+        }
+        #endregion Deserialization an exteranl MOF file tests
+
+        #region Fake
+        private CimClass GetClass(string serverName, string namespaceName, string className)
+        {
+            CimInstance cimInstance = new CimInstance(className, namespaceName);
+            return cimInstance.CimClass;
+        }
+
+        private byte[] GetFileContent(string fileName)
+        {
+            return Helpers.GetBytesFromString(fileName);
+        }
+        #endregion Fake
+    }
+}
\ No newline at end of file
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimSessionTest.cs b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimSessionTest.cs
new file mode 100644
index 0000000..7750a0b
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/CimSessionTest.cs
@@ -0,0 +1,37 @@
+/*============================================================================
+* Copyright (C) Microsoft Corporation, All rights reserved.
+*=============================================================================
+*/
+
+namespace Microsoft.Management.Infrastructure.UnitTests
+{
+    using Microsoft.Management.Infrastructure;
+    using MMI.Tests;
+
+    public class CimSessionTest
+    {
+        #region Test create
+        [TDDFact]
+        public void Create_ComputerName_Null()
+        {
+            using (CimSession cimSession = CimSession.Create(null))
+            {
+                MMI.Tests.Assert.NotNull(cimSession, "cimSession should not be null");
+                MMI.Tests.Assert.Null(cimSession.ComputerName, "cimSession.ComputerName should not be the same as the value passed to Create method");
+            }
+        }
+
+        [TDDFact]
+        public void Create_ComputerName_Localhost()
+        {
+            using (CimSession cimSession = CimSession.Create("localhost"))
+            {
+                MMI.Tests.Assert.NotNull(cimSession, "cimSession should not be null");
+                MMI.Tests.Assert.Equal("localhost", cimSession.ComputerName, "cimSession.ComputerName should not be the same as the value passed to Create method");
+                MMI.Tests.Assert.True(cimSession.ToString().Contains("localhost"), "cimSession.ToString should contain computer name");
+            }
+        }
+        // Todo: will add more test cases
+        #endregion Test create
+    }
+}
\ No newline at end of file
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dmtftypes.mof b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dmtftypes.mof
new file mode 100644
index 0000000..6f65133
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dmtftypes.mof
@@ -0,0 +1,96 @@
+#pragma include ("QuaLIFIErs.mof")
+
+[Abstract,
+DEscription("A base class for all \"values\"")]
+class TestClass_PropertyValues {
+
+[key] uint64 v_Key; 
+
+};
+
+class TestClass_ForEmbedded 
+{	
+	[key] string embeddedStringValue;	
+};
+
+
+class TestClass_AllDMTFTypes : TestClass_PropertyValues
+{
+	boolean sbool;
+	uiNT8 suint8;
+	sINT8 ssint8;
+	UINT16 sUINT16;
+	SINT16 ssint16;
+	uinT32 suint32;
+	sint32 ssint32;
+	uint64 suint64;
+	SINt64 ssint64;
+	reAL32 srEal32;
+	REAL64 sREAL64;
+	chAR16 schar16;
+	string sstring;
+	datetime sDATETIME;
+
+	boolean a_bool[];
+	uiNT8 a_uint8[];
+	sINT8 a_sint8[];
+	UINT16 a_UINT16[];
+	SINT16 a_sint16[];
+	uinT32 a_uint32[];
+	sint32 a_sint32[];
+	uint64 a_uint64[];
+	SINt64 a_sint64[];
+	reAL32 a_rEal32[];
+	REAL64 a_REAL64[];
+	chAR16 a_char16[];
+	string a_string[];
+	datetime a_DATETIME[];
+	
+	TestClass_ForEmbedded ref embeddedReference;
+	
+    [EmbeddedInstance("TestClass_ForEmbedded")] string embeddedinstance;
+    [EmbeddedInstance("TestClass_ForEmbedded")] string embeddedinstancearray[];
+    [EmbeddedObject] string embeddedobject;
+    [EmbeddedObject] string embeddedobjectarray[];
+
+	//Methods
+
+	uint32 GetReal32Array([in] uint32 count, [out] real32 real32Array[]);
+	uint32 SetReal32Array([in] real32 real32Array[]);
+
+	uint32 	GetReal64Array([in] uint32 count,[out] real64 real64Array[]);
+	uint32	SetReal64Array([in] real64 real64Array[]);
+
+	uint32 	GetChar16Array([in] uint32 count,[out] char16 charArray[]);
+	uint32	SetChar16Array([in] Char16 charArray[]);
+
+	uint32 	GetStringArray([in] uint32 count,[out] string StringArray[]);
+	uint32	SetStringArray([in] string StringArray[]);
+
+	uint32 	GetDateTimeArray([in] uint32 count,[out] datetime datetimeArray[]);
+	uint32	SetdatetimeArray([in] datetime datetimeArray[]);
+
+	uint32 GetReferenceArray([in] uint32 count,[out] TestClass_ForEmbedded ref embeddedRefArray[]);
+	uint32 SetReferenceArray([in] TestClass_ForEmbedded ref embeddedRefArray[]);
+
+    [Override("Reboot"): ToSubClass, ValueMap{"0", ".."}: ToSubClass, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx|EWX_REBOOT"}: ToSubClass] 		
+		uint32 Reboot();
+
+	[Override("Shutdown"): ToSubClass, ValueMap{"0", ".."}: ToSubClass, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx|EWX_SHUTDOWN"}: ToSubClass] 
+		uint32 Shutdown();
+
+	[ValueMap{"0", ".."}: ToSubClass, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx"}:ToSubClass] 
+		uint32 Win32Shutdown(
+				[in, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx"}: ToSubClass] sint32 Flags, 
+				[in, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx"}: ToSubClass] sint32 Reserved);
+
+	[ValueMap{"0", ".."}: ToSubClass, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx"}: ToSubClass] 
+		uint32 Win32ShutdownTracker(
+					[in] uint32 Timeout, 
+					[in, MappingStrings{"Win32API|System Shutdown Functions|InitiateSystemShutdownEx"}: ToSubClass] string Comment, 
+					[in, MappingStrings{"Win32API|System Shutdown Functions|InitiateSystemShutdownEx"}: ToSubClass] uint32 ReasonCode, 
+					[in, MappingStrings{"Win32API|System Shutdown Functions|ExitWindowsEx"}: ToSubClass] sint32 Flags);
+
+	[ValueMap{"0", ".."}: ToSubClass] 
+		uint32 SetDateTime([in] DateTime LocalDateTime);
+};
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscinstance.mof b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscinstance.mof
new file mode 100644
index 0000000..8c2a1f1
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscinstance.mof
@@ -0,0 +1,19 @@
+instance of MSFT_WindowsCredential as $x
+{
+    UserName="AAA";
+    Password="BBB";
+    Domain="CCC";
+};
+
+
+instance of MSFT_FileDirectoryConfiguration
+{
+   ResourceId="R1";
+   DestinationPath="C:\\Test";
+   credential=$x;
+};
+
+instance of MSFT_ConfigurationDocument
+{
+  version="1.0.0";
+};
\ No newline at end of file
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscschema.mof b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscschema.mof
new file mode 100644
index 0000000..8c12a47
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/dscschema.mof
@@ -0,0 +1,113 @@
+[Abstract, 
+ version("1.0.0"), 
+ Description (
+    "Credential to use for DSC configuration providers." )]
+class MSFT_BaseCredential 
+{   
+        [Description 
+            ("UserName is the name of the user for an authorization service to map to an identity." ), 
+         MaxLen ( 256 )]
+    string UserName;
+        [Description
+        ("UserPassword property may contain a passwordused to access resources." )]
+    string Password;
+};
+
+[version("1.0.0"), Description ("Credential to use for DSC configuration providers on Windows")]
+class MSFT_WindowsCredential : MSFT_BaseCredential
+{   
+        [Description 
+            ("Domain name of the user if it below to a LDAP directory." ), 
+         MaxLen ( 256 )]
+    string Domain;
+};
+
+[Abstract, version("1.0.0"),
+ Description (
+    "Base schema for all configuration providers that will be imported by powershell extension." )]
+class MSFT_BaseResourceConfiguration 
+{
+	    [required,
+         Description (
+            "Unique Id for a resource instance." )]
+     string ResourceId;
+	
+        [write, 
+         Description (
+            "Source Info to correlate it back to powershell configuration script." )]
+    string SourceInfo;
+
+	    [write,
+         Description (
+            "List of resources this resource depends on." )]
+    string Requires[];
+
+	    [write,
+         Description (
+            "Whether to reapply the config even if it is not changed." )]
+    Boolean Force;
+};
+
+
+class MSFT_FileDirectoryConfiguration:MSFT_BaseResourceConfiguration
+{
+    [Key, Description("File name and path on target node to copy or create.")]
+    string DestinationPath;
+
+    [Write, Values{"File", "Directory", "Absent"}, Description("Defines how to evaluate the existents of the destination file.")]
+    string Ensure;
+
+    [Write, Description("File name and path of file to copy from.")]
+    string SourcePath;
+
+    [Write, Description("Contains the contents as string for the file. To create empty file contents must contain empty string. Contents written and compared using UTF-8 character encoding.")]
+    string Contents;
+    
+    [Write, Values{"SHA-1", "SHA-256", "SHA-512", "CreatedDate", "ModifiedDate"}, Description("The checksum type to use when determining whether two files are the same.")]
+    string Checksum;
+    
+    [Write, Description("ACLs - Security descriptor for file / directory. Format as SDDL string.")]
+    string SecurityDescriptor;
+
+    [Write, Description("Recurse all child directories")]    
+    boolean Recurs;
+       
+    [Write, Description("Whether unmanaged files should be purged from target. ")]
+    boolean Purge;
+    
+    [Write, EmbeddedInstance("MSFT_WindowsCredential"), Description("Credential to access remote resources.")]
+    string credential;    
+
+    [Read, Description("Created date")]
+    datetime CreatedDate;
+
+    [Read, Description("Modified date")]
+    datetime ModifiedDate;
+    
+    //We are using definitions of FileAttributes enumaration in .NET, except "Device" which is reserved for future use
+    [Write, Values{"ReadOnly", "Hidden", "System", "Archive"},
+    Description("Attributes for file / directory")]
+    string Attributes[];
+    
+    [Read, Description("")]
+    uint64 Size;
+};
+
+Class MSFT_ConfigurationDocument
+{
+        [Description (
+            "Configuration document version information, configuration engine can use to log." )]
+	String Version;
+
+        [Description (
+            "Configuration document Author information." )]
+	String Author;
+
+        [Description (
+            "Configuration document Copyright information." )]
+	String Copyright;
+
+        [Description (
+            "Configuration document Help URI." )]
+	String HelpInfoUri;
+};
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintinstance.mof b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintinstance.mof
new file mode 100644
index 0000000..1935bf1
Binary files /dev/null and b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintinstance.mof differ
diff --git a/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintschema.mof b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintschema.mof
new file mode 100644
index 0000000..4c06e08
--- /dev/null
+++ b/test/Microsoft.Management.Infrastructure.Tests/UnitTests/TestData/mintschema.mof
@@ -0,0 +1,141 @@
+/**********************************************************
+  
+  Mint schema
+
+**********************************************************/
+
+
+class MSFT_Expression { 
+  string SourceInfo;    /* defaults to empty string */
+  string SourceLines[]; /* defaults to empty array,
+                           null values == empty string */
+};
+class MSFT_ExpressionIdentifier : MSFT_Expression {
+  string name;
+};
+class MSFT_ExpressionKeywordParameter : MSFT_ExpressionIdentifier {
+  string keywordalias; /* if set, this string is used for keyword binding instead of the name */
+                       /* restricted to [A-Za-z0-9_]+ */
+};
+class MSFT_ExpressionKeywordValue : MSFT_Expression {
+  string keyword; /* restricted to [A-Za-z0-9_]+ */
+};
+/* only valid as a base class, not as an instance */
+class MSFT_ExpressionValue : MSFT_Expression { 
+  boolean hasValue;
+};
+class MSFT_ExpressionCall : MSFT_Expression {
+  [EmbeddedInstance("MSFT_Expression")] string function;
+  [EmbeddedInstance("MSFT_Expression")] string pipeline; /* defaults to void value */
+  [EmbeddedInstance("MSFT_Expression")] string arguments[];
+};
+class MSFT_ExpressionLambda : MSFT_Expression {
+  [EmbeddedInstance("MSFT_ExpressionIdentifier")] string pipeline; /* may be null - pipeline input cannot be passed when applying the lambda */
+  [EmbeddedInstance("MSFT_ExpressionIdentifier")] string parameters[];
+  [EmbeddedInstance("MSFT_Expression")] string body;
+};
+class MSFT_ExpressionIf : MSFT_Expression {
+  [EmbeddedInstance("MSFT_Expression")] string condition;
+  [EmbeddedInstance("MSFT_Expression")] string truecase;
+  [EmbeddedInstance("MSFT_Expression")] string falsecase; /* may be null - implies void value */
+};
+class MSFT_ExpressionLoop : MSFT_Expression {
+  [EmbeddedInstance("MSFT_Expression")] string condition;
+  [EmbeddedInstance("MSFT_Expression")] string body;
+  [EmbeddedInstance("MSFT_Expression")] string result; /* may be null - implies void value */
+};
+class MSFT_ExpressionAssignment : MSFT_Expression {
+  [EmbeddedInstance("MSFT_ExpressionIdentifier")] string lvalue;
+  [EmbeddedInstance("MSFT_Expression")] string rvalue; /* may be null - implies void value */
+};
+class MSFT_ExpressionLet : MSFT_Expression {
+  [EmbeddedInstance("MSFT_ExpressionAssignment")] string initializers[];
+  [EmbeddedInstance("MSFT_Expression")] string body;
+};
+class MSFT_ExpressionBegin : MSFT_Expression {
+  [EmbeddedInstance("MSFT_Expression")] string body[];
+};
+class MSFT_ExpressionValue_boolean : MSFT_ExpressionValue {
+  boolean value;
+};
+class MSFT_ExpressionValue_uint8 : MSFT_ExpressionValue {
+  uint8 value;
+};
+class MSFT_ExpressionValue_sint8 : MSFT_ExpressionValue {
+  sint8 value;
+};
+class MSFT_ExpressionValue_uint16 : MSFT_ExpressionValue {
+  uint16 value;
+};
+class MSFT_ExpressionValue_sint16 : MSFT_ExpressionValue {
+  sint16 value;
+};
+class MSFT_ExpressionValue_uint32 : MSFT_ExpressionValue {
+  uint32 value;
+};
+class MSFT_ExpressionValue_sint32 : MSFT_ExpressionValue {
+  sint32 value;
+};
+class MSFT_ExpressionValue_uint64 : MSFT_ExpressionValue {
+  uint64 value;
+};
+class MSFT_ExpressionValue_sint64 : MSFT_ExpressionValue {
+  sint64 value;
+};
+class MSFT_ExpressionValue_real32 : MSFT_ExpressionValue {
+  real32 value;
+};
+class MSFT_ExpressionValue_real64 : MSFT_ExpressionValue {
+  real64 value;
+};
+class MSFT_ExpressionValue_char16 : MSFT_ExpressionValue {
+  char16 value;
+};
+class MSFT_ExpressionValue_datetime : MSFT_ExpressionValue {
+  datetime value;
+};
+class MSFT_ExpressionValue_string : MSFT_ExpressionValue {
+  string value;
+};
+class MSFT_ExpressionValue_booleana : MSFT_ExpressionValue {
+  boolean value[];
+};
+class MSFT_ExpressionValue_uint8a : MSFT_ExpressionValue {
+  uint8 value[];
+};
+class MSFT_ExpressionValue_sint8a : MSFT_ExpressionValue {
+  sint8 value[];
+};
+class MSFT_ExpressionValue_uint16a : MSFT_ExpressionValue {
+  uint16 value[];
+};
+class MSFT_ExpressionValue_sint16a : MSFT_ExpressionValue {
+  sint16 value[];
+};
+class MSFT_ExpressionValue_uint32a : MSFT_ExpressionValue {
+  uint32 value[];
+};
+class MSFT_ExpressionValue_sint32a : MSFT_ExpressionValue {
+  sint32 value[];
+};
+class MSFT_ExpressionValue_uint64a : MSFT_ExpressionValue {
+  uint64 value[];
+};
+class MSFT_ExpressionValue_sint64a : MSFT_ExpressionValue {
+  sint64 value[];
+};
+class MSFT_ExpressionValue_real32a : MSFT_ExpressionValue {
+  real32 value[];
+};
+class MSFT_ExpressionValue_real64a : MSFT_ExpressionValue {
+  real64 value[];
+};
+class MSFT_ExpressionValue_char16a : MSFT_ExpressionValue {
+  char16 value[];
+};
+class MSFT_ExpressionValue_datetimea : MSFT_ExpressionValue {
+  datetime value[];
+};
+class MSFT_ExpressionValue_stringa : MSFT_ExpressionValue {
+  string value[];
+};