public void test00() { // Create a ComponentInfo class and set initial values. ComponentInfo ci = new ComponentInfo() { name = "RES_0603", elementType = 'X', parameters = new Dictionary<String, String>() { {"RVAL", "1.0k"}, {"Bogus", "Yeah"} }, pins = new List<string>() { "PinOne", "PinTwo" } }; Assert.False(ci.Equals(null)); Assert.True(ci.Equals(ci)); // Create a ComponentInfo class and set initial values the same as before. ComponentInfo ci2 = new ComponentInfo() { name = "RES_0603", elementType = 'X', parameters = new Dictionary<String, String>() { {"RVAL", "1.0k"}, {"Bogus", "Yeah"} }, pins = new List<string>() { "PinOne", "PinTwo" } }; Assert.True(ci.Equals(ci2)); Assert.True(ci2.Equals(ci2)); Assert.True(ci2.Equals(ci)); // Create a ComponentInfo class but don't set initial values. ComponentInfo ci3 = new ComponentInfo(); Assert.True(ci3.Equals(ci3)); Assert.False(ci2.Equals(ci3)); Assert.False(ci3.Equals(ci)); // Create a ComponentInfo class and set initial values slightly differently. ComponentInfo ci4 = new ComponentInfo() { name = "RES_0603", elementType = 'X', parameters = new Dictionary<String, String>() { {"RVAL", "1.0k"} }, pins = new List<string>() { "PinOne", "PinTwo" } }; Assert.True(ci4.Equals(ci4)); Assert.False(ci2.Equals(ci4)); // Create a ComponentInfo class with the pins in a different order. ComponentInfo ci5 = new ComponentInfo() { name = "RES_0603", elementType = 'X', parameters = new Dictionary<String, String>() { {"RVAL", "1.0k"} }, pins = new List<string>() { "PinTwo", "PinOne", } }; Assert.True(ci5.Equals(ci5)); Assert.False(ci5.Equals(ci4)); }