예제 #1
0
 public void SetUp()
 {
     Ecell.MessageType type = MessageType.Debug;
     string message = null;
     string group = null;
     Ecell.Objects.EcellObject obj = null;
     _unitUnderTest = new ObjectReport(type, message, group, obj);
 }
예제 #2
0
 public void TestConstructorObjectReport()
 {
     Ecell.MessageType type = MessageType.Error;
     string message = "Error";
     string group = "Group";
     EcellObject obj = EcellObject.CreateObject("Model", "/:S",EcellObject.VARIABLE, EcellObject.VARIABLE, new List<EcellData>());
     ObjectReport testObjectReport = new ObjectReport(type, message, group, obj);
     Assert.IsNotNull(testObjectReport, "Constructor of type, ObjectReport failed to create instance.");
     Assert.AreEqual(MessageType.Error, testObjectReport.Type, "Type is unexpected value.");
     Assert.AreEqual(message, testObjectReport.Message, "Message is unexpected value.");
     Assert.AreEqual(group, testObjectReport.Group, "Group is unexpected value.");
     Assert.AreEqual(obj, testObjectReport.Object, "Object is unexpected value.");
     Assert.AreEqual(obj.FullID, testObjectReport.Location, "Location is unexpected value.");
     Assert.AreNotEqual(0, testObjectReport.GetHashCode(), "GetHashCode method returns unexpected value.");
     Assert.IsNotNull(testObjectReport.ToString(), "ToString method returns unexpected value.");
 }
예제 #3
0
        public void TestEquals()
        {
            Ecell.MessageType type = MessageType.Error;
            string message = "Error";
            string group = "Group";
            EcellObject obj = EcellObject.CreateObject("Model", "/:S", EcellObject.VARIABLE, EcellObject.VARIABLE, new List<EcellData>());

            ObjectReport testObjectReport1 = new ObjectReport(type, message, group, obj);
            Assert.IsTrue(testObjectReport1.Equals(testObjectReport1));

            Assert.IsFalse(testObjectReport1.Equals(new object()));

            ObjectReport testObjectReport2 = new ObjectReport(MessageType.Debug, message, group, obj);
            Assert.IsFalse(testObjectReport1.Equals(testObjectReport2));

            ObjectReport testObjectReport3 = new ObjectReport(type, message, "Hoge", obj);
            Assert.IsFalse(testObjectReport1.Equals(testObjectReport3));
        }
예제 #4
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }