예제 #1
0
 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);
 }
예제 #2
0
        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.");
        }
예제 #3
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
예제 #4
0
        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.");
        }