public void SetUp() { Ecell.MessageType type = MessageType.Warning; string message = null; string group = null; Ecell.Objects.EcellObject obj = null; string propertyName = null; _unitUnderTest = new ObjectPropertyReport(type, message, group, obj, propertyName); }
public void TestConstructorObjectPropertyReport() { Ecell.MessageType type = MessageType.Error; string message = "Error"; string group = "Group"; string propertyName = "Value"; EcellObject obj = EcellObject.CreateObject("Model", "/:S", EcellObject.VARIABLE, EcellObject.VARIABLE, new List<EcellData>()); obj.SetEcellValue(propertyName, new EcellValue(0.1)); ObjectPropertyReport testObjectPropertyReport = new ObjectPropertyReport(type, message, group, obj, propertyName); Assert.IsNotNull(testObjectPropertyReport, "Constructor of type, ObjectPropertyReport failed to create instance."); Assert.IsNotNull(testObjectPropertyReport, "Constructor of type, ObjectReport failed to create instance."); Assert.AreEqual(MessageType.Error, testObjectPropertyReport.Type, "Type is unexpected value."); Assert.AreEqual(message, testObjectPropertyReport.Message, "Message is unexpected value."); Assert.AreEqual(group, testObjectPropertyReport.Group, "Group is unexpected value."); Assert.AreEqual(obj, testObjectPropertyReport.Object, "Object is unexpected value."); Assert.AreEqual(obj.FullID + ":Value", testObjectPropertyReport.Location, "Location is unexpected value."); Assert.AreEqual(propertyName, testObjectPropertyReport.PropertyName, "Location is unexpected value."); Assert.AreNotEqual(0, testObjectPropertyReport.GetHashCode(), "GetHashCode method returns unexpected value."); Assert.IsNotNull(testObjectPropertyReport.ToString(), "ToString method returns unexpected value."); }
public void TearDown() { _unitUnderTest = null; }
public void TestEqual() { Ecell.MessageType type = MessageType.Error; string message = "Error"; string group = "Group"; string propertyName = "Value"; EcellObject obj = EcellObject.CreateObject("Model", "/:S", EcellObject.VARIABLE, EcellObject.VARIABLE, new List<EcellData>()); obj.SetEcellValue(propertyName, new EcellValue(0.1)); ObjectPropertyReport report = new ObjectPropertyReport(type, message, group, obj, propertyName); bool equal = report.Equals(report); Assert.AreEqual(true, equal, "Equals method returned unexpected value."); equal = report.Equals(null); Assert.AreEqual(false, equal, "Equals method returned unexpected value."); // true equal = report.Equals(new AnalysisReport(type, message, group, "job")); Assert.AreEqual(true, equal, "Equals method returned unexpected value."); }