Exemplo n.º 1
0
 public void TestConstructor()
 {
     LoggerEntry value = null;
     value = new LoggerEntry("Model", "/:ID", "Process", "Process:/:ID:Activity");
     Assert.IsNotNull(value, "Constructor of of type, LoggerEntry failed to create instance.");
     Assert.IsFalse(value.IsLoaded, "IsLogging is not expected value.");
     Assert.AreEqual("Model", value.ModelID, "ModelID is not expected value.");
     Assert.AreEqual("/:ID", value.ID, "ID is not expected value.");
     Assert.AreEqual("Process", value.Type, "ModelID is not expected value.");
     Assert.AreEqual("Process:/:ID:Activity", value.FullPN, "ModelID is not expected value.");
     Assert.AreNotEqual(0, value.GetHashCode(), "GetHashCode returns unexpected value.");
 }
Exemplo n.º 2
0
        /// <summary>
        /// Import the log data from the file to the selected window.
        /// </summary>
        /// <param name="fileName">the log file name.</param>
        /// <param name="win">the window displayed the log.</param>
        public void ImportLog(string fileName, TraceWindow win)
        {
            try
            {
                if (fileName == null)
                {
                    m_openFileDialog.FileName = "";
                    m_openFileDialog.Filter = Constants.FilterLogFile;
                    if (m_openFileDialog.ShowDialog() != DialogResult.OK)
                        return;
                    fileName = m_openFileDialog.FileName;
                }

                if (m_logList.ContainsKey(fileName))
                {
                    if (win != null)
                    {
                        m_owner.ChangeDisplayStatus(m_logList[fileName], win.Name, true);
                    }
                    return;
                }

                LogData log = m_owner.DataManager.LoadSimulationResult(fileName);
                if (log.logValueList.Count <= 0)
                {
                    Util.ShowWarningDialog(string.Format(MessageResources.WarnNoLog, fileName));
                    return;
                }
                string[] ele = log.propName.Split(new char[] { ':' });
                string propName = "Log:" + log.key + ":" + ele[ele.Length - 1];

                LoggerEntry entry = new LoggerEntry(log.model, log.key, log.type, propName);
                entry.IsLoaded = true;
                entry.FileName = fileName;
                m_logList.Add(fileName, entry);

                m_owner.LoggerManager_LoggerAddEvent(null, new LoggerEventArgs(entry.FullPN, entry));
            }
            catch (Exception)
            {
                Util.ShowErrorDialog(String.Format(MessageResources.ErrInvalidFile, fileName));
            }
        }
Exemplo n.º 3
0
 public void Setup()
 {
     _unitUnderTest = new LoggerEntry("Model", "/:ID", "Process", "Process:/:ID:Activity");
 }
Exemplo n.º 4
0
 public void Setup()
 {
     LoggerEntry ent = new LoggerEntry("ModelID", "ID", "Process", "FullPN");
     _unitUnderTest = new LoggerEventArgs("orgFullPN", ent);
 }
Exemplo n.º 5
0
 /// <summary>
 /// The event sequence on adding the logger at other plugin.
 /// </summary>
 /// <param name="entry">Logger entry data.</param>
 public void LoggerAdd(LoggerEntry entry)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// Change the status of display.
 /// </summary>
 /// <param name="entry">the logger entry.</param>
 /// <param name="name">the window name.</param>
 /// <param name="isDisplay">the flag whether the log entry is shown.</param>
 public void ChangeDisplayStatus(LoggerEntry entry, string name, bool isDisplay)
 {
     foreach (TraceWindow w in m_winList)
     {
         if (w.TabText.Equals(name))
         {
             w.ChangedDisplayStatus(entry, isDisplay);
         }
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Invoke method to add the data to DataGridView.
        /// </summary>
        /// <param name="entry">the log entry</param>
        /// <param name="tag">tag data</param>
        void AddToEntry(LoggerEntry entry, TagData tag)
        {
            TagData tmp = tag;
            if (!m_tagList.ContainsKey(tag.ToString()))
            {
                m_entry.Add(tag, new List<TraceWindow>());
                m_tagList.Add(tag.ToString(), tag);
            }
            else
            {
                tmp = m_tagList[tag.ToString()];
            }

            if (m_win == null)
            {
                ShowTracerWindow(this, new EventArgs());
            }
            if (m_entry[tmp].Contains(m_win)) return;
            m_entry[tmp].Add(m_win);
            m_win.AddLoggerEntry(entry, tag);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Get the flag whether this entry is displayed.
 /// </summary>
 /// <param name="entry">the logger entry.</param>
 /// <returns>Return true if </returns>
 public bool IsDisplay(LoggerEntry entry)
 {
     TagData tag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
     tag.isLoaded = entry.IsLoaded;
     tag.FileName = entry.FileName;
     if (m_entryDic.ContainsKey(tag.ToShortString())) return true;
     return false;
 }
Exemplo n.º 9
0
        /// <summary>
        /// Changed the logger object.
        /// </summary>
        /// <param name="orgFullPN">the orijinal FullPN.</param>
        /// <param name="entry">the logger object.</param>
        public void LoggerChanged(string orgFullPN, LoggerEntry entry)
        {
            TagData otag = new TagData(entry.ModelID, entry.ID, entry.Type, orgFullPN, true);
            TagData ntag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
            otag.isLoaded = entry.IsLoaded;
            otag.FileName = entry.FileName;
            ntag.isLoaded = entry.IsLoaded;
            ntag.FileName = entry.FileName;
            if (!m_entryDic.ContainsKey(otag.ToShortString()))
                return;

            if (orgFullPN != entry.FullPN)
            {
                m_entryDic[ntag.ToShortString()] = m_entryDic[otag.ToShortString()];
                m_entryDic[ntag.ToShortString()].Path = entry.FullPN;
                m_entryDic.Remove(otag.ToShortString());
            }

            m_entryDic[ntag.ToShortString()].SetStyle(entry.LineStyle);
            m_entryDic[ntag.ToShortString()].SetVisible(entry.IsShown);
            m_entryDic[ntag.ToShortString()].SetColor(entry.Color);
            m_entryDic[ntag.ToShortString()].SetLineWidth(entry.LineWidth);
            m_entryDic[ntag.ToShortString()].SetY2Axis(entry.IsY2Axis);
            if (entry.IsY2Axis)
            {
                m_zCnt.GraphPane.Y2Axis.IsVisible = true;
            }
            else
            {
                bool isHit = false;
                foreach (string entStr in m_entryDic.Keys)
                {
                    if (m_entryDic[entStr].IsY2)
                    {
                        m_zCnt.GraphPane.Y2Axis.IsVisible = true;
                        isHit = true;
                        break;

                    }
                }
                if (isHit == false)
                    m_zCnt.GraphPane.Y2Axis.IsVisible = false;
            }

            if (entry.IsShown)
            {
                if (!m_zCnt.GraphPane.IsZoomed)
                {
                    m_zCnt.AxisChange();
                }
            }
            m_zCnt.Refresh();
        }
Exemplo n.º 10
0
        /// <summary>
        /// Add logger entry to DataGridView and ZedGraphControl.
        /// Added logger entry is registed to m_paneDic.
        /// </summary>
        /// <param name="entry">the log entry</param>
        /// <param name="tag">the tag of logger entry</param>
        public void AddLoggerEntry(LoggerEntry entry, TagData tag)
        {
            LineItem i = m_zCnt.GraphPane.AddCurve(entry.FullPN,
                    new PointPairList(), entry.Color, SymbolType.None);
            i.Line.Width = entry.LineWidth;
            i.Line.Style = entry.LineStyle;
            LineItem i1 = m_zCnt.GraphPane.AddCurve(entry.FullPN,
                    new PointPairList(), entry.Color, SymbolType.None);
            i1.Line.Width = entry.LineWidth;
            i1.Line.Style = entry.LineStyle;
            m_entryDic.Add(tag.ToShortString(), new TraceEntry(tag.M_path, i, i1, tag.IsContinue, tag.isLoaded));
            m_tagDic.Add(tag.ToShortString(), tag.IsContinue);
            if (!tag.isLoaded)
            {
                if (m_logCount == 0 &&
                    (m_owner.PluginManager.Status == ProjectStatus.Running ||
                    m_owner.PluginManager.Status == ProjectStatus.Suspended ||
                    m_owner.PluginManager.Status == ProjectStatus.Stepping))
                    this.StartSimulation();
                m_logCount++;
            }
            else
            {
                LogData log = m_owner.DataManager.LoadSimulationResult(entry.FileName);

                string[] ele = log.propName.Split(new char[] { ':' });
                LogData newLog = new LogData(log.model, log.key, Constants.xpathLog, ele[ele.Length - 1], log.logValueList);
                newLog.IsLoaded = true;
                newLog.FileName = entry.FileName;
                List<LogData> logList = new List<LogData>();
                logList.Add(newLog);
                m_entryDic[tag.ToShortString()].SetVisible(entry.IsShown);
                AddPoints(log.logValueList[log.logValueList.Count - 1].time, log.logValueList[log.logValueList.Count - 1].time, logList, true);
            }
            m_logList.Add(tag);
            m_entryCount++;
        }
Exemplo n.º 11
0
 /// <summary>
 /// Change the display status of data.
 /// </summary>
 /// <param name="entry">the log entry object.</param>
 /// <param name="isDisplay">the flag whether this entry is displayed.</param>
 public void ChangedDisplayStatus(LoggerEntry entry, bool isDisplay)
 {
     TagData tag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
     tag.isLoaded = entry.IsLoaded;
     tag.FileName = entry.FileName;
     if (isDisplay)
     {
         AddLoggerEntry(entry, tag);
     }
     else
     {
         RemoveLoggerEntry(tag);
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// Delete the logger entry.
        /// </summary>
        /// <param name="entry">the deleted logger entry.</param>
        public void LoggerDeleted(LoggerEntry entry)
        {
            if (m_isChanged) return;

            int findex = FullPNColumn.Index;
            for (int i = 0; i < loggerDataGrid.Rows.Count; i++)
            {
                LoggerEntry ent = loggerDataGrid.Rows[i].Tag as LoggerEntry;
                if (ent.Equals(entry))
                {
                    loggerDataGrid.Rows.RemoveAt(i);
                    break;
                }
            }

            if (entry.IsLoaded)
            {
                m_logList.Remove(entry.FileName);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Change the logger entry.
        /// </summary>
        /// <param name="orgFullPN">the original FullPN.</param>
        /// <param name="entry">the changed logger entry.</param>
        public void LoggerChanged(string orgFullPN, LoggerEntry entry)
        {
            if (m_isChanged)
                return;

            int findex = FullPNColumn.Index;
            int rindex = -1;
            for (int i = 0; i < loggerDataGrid.Rows.Count; i++)
            {
                LoggerEntry ent = loggerDataGrid.Rows[i].Tag as LoggerEntry;
                if (ent.Equals(entry))
                {
                    rindex = i;
                    break;
                }
            }

            if (rindex == -1)
                return;
            Bitmap b = new Bitmap(20, 20);
            Graphics g = Graphics.FromImage(b);
            Pen pen = new Pen(entry.Color);
            g.FillRectangle(pen.Brush, 3, 3, 14, 14);
            g.ReleaseHdc(g.GetHdc());

            Bitmap b1 = new Bitmap(20, 20);
            Graphics g1 = Graphics.FromImage(b1);
            pen.DashStyle = entry.LineStyle;
            g1.DrawLine(pen, 0, 10, 20, 10);
            g1.ReleaseHdc(g1.GetHdc());

            loggerDataGrid[IsShownColumn.Index, rindex].Value = entry.IsShown;
            loggerDataGrid[FullPNColumn.Index, rindex].Value = entry.FullPN;
            loggerDataGrid[ColorColumn.Index, rindex].Value = b;
            loggerDataGrid[LineColumn.Index, rindex].Value = b1;
            m_isChanged = true;
            loggerDataGrid[IsY2Column.Index, rindex].Value = entry.IsY2Axis;
            m_isChanged = false;
            loggerDataGrid.Rows[rindex].Tag = entry;
            loggerDataGrid.EndEdit();
            loggerDataGrid.Refresh();
        }
Exemplo n.º 14
0
        /// <summary>
        /// Add the logger entry.
        /// </summary>
        /// <param name="entry">the added logger entry.</param>
        public void LoggerAdd(LoggerEntry entry)
        {
            Bitmap b = new Bitmap(20, 20);
            Graphics g = Graphics.FromImage(b);
            Pen pen = new Pen(entry.Color);
            g.FillRectangle(pen.Brush, 3, 3, 14, 14);
            g.ReleaseHdc(g.GetHdc());

            Bitmap b1 = new Bitmap(20, 20);
            Graphics g1 = Graphics.FromImage(b1);
            pen.DashStyle = entry.LineStyle;
            pen.Width = entry.LineWidth;
            g1.DrawLine(pen, 0, 10, 20, 10);
            g1.ReleaseHdc(g1.GetHdc());

            DataGridViewRow r = new DataGridViewRow();
            DataGridViewCheckBoxCell c1 = new DataGridViewCheckBoxCell();
            c1.Value = entry.IsShown;
            r.Cells.Add(c1);

            DataGridViewTextBoxCell c2 = new DataGridViewTextBoxCell();
            c2.Value = entry.FullPN;
            r.Cells.Add(c2);

            DataGridViewImageCell c3 = new DataGridViewImageCell();
            c3.Value = b;
            r.Cells.Add(c3);

            DataGridViewImageCell c4 = new DataGridViewImageCell();
            c4.Value = b1;
            r.Cells.Add(c4);

            DataGridViewCheckBoxCell c5 = new DataGridViewCheckBoxCell();
            c5.Value = entry.IsY2Axis;
            r.Cells.Add(c5);

            r.Tag = entry;
            loggerDataGrid.Rows.Add(r);
            c2.ReadOnly = true;
        }
Exemplo n.º 15
0
        /// <summary>
        /// Chage the logger entry.
        /// </summary>
        /// <param name="orgFullPN">the original FullPN.</param>
        /// <param name="entry">the logger entry.</param>
        public void LoggerChanged(string orgFullPN, LoggerEntry entry)
        {
            LoggerEntry m = GetLoggerEntryForFullPN(orgFullPN);
            if (m != null)
            {
                m_loggerList.Remove(m);
            }
            m_loggerList.Add(entry);

            if (LoggerChangedEvent != null)
            {
                LoggerChangedEvent(this, new LoggerEventArgs(orgFullPN, entry));
            }
        }
Exemplo n.º 16
0
 public void TestGetLoggerEntryForFullPN()
 {
     LoggerEntry ent = new LoggerEntry("ModelID", "Key", "Process", "FullPN");
     _unitUnderTest.AddLoggerEntry(ent);
     LoggerEntry res = _unitUnderTest.GetLoggerEntryForFullPN("FullPN1");
     Assert.AreEqual(null, res, "GetLoggerEntryForFullPN  is unexpected work.");
     res = _unitUnderTest.GetLoggerEntryForFullPN("FullPN");
     Assert.AreNotEqual(null, res, "GetLoggerEntryForObject is unexpected work.");
 }
Exemplo n.º 17
0
        /// <summary>
        /// Remove the logger entry.
        /// </summary>
        /// <param name="entry">the removed logger entry.</param>
        public void LoggerRemoved(LoggerEntry entry)
        {
            if (entry == null) return;

            if (!m_loggerList.Contains(entry))
                return;

            m_loggerList.Remove(entry);

            if (LoggerDeleteEvent != null)
            {
                LoggerDeleteEvent(this, new LoggerEventArgs(entry.FullPN, entry));
            }
        }
Exemplo n.º 18
0
 public void TestGetLoggerEntryForObject()
 {
     LoggerEntry ent = new LoggerEntry("ModelID", "Key", "Process", "FullPN");
     _unitUnderTest.AddLoggerEntry(ent);
     List<LoggerEntry> res = _unitUnderTest.GetLoggerEntryForObject("Key", "Process");
     Assert.AreEqual(1, res.Count, "GetLoggerEntryForObject is unexpected work.");
 }
Exemplo n.º 19
0
 /// <summary>
 /// Get the window list to display the logger entry.
 /// </summary>
 /// <param name="entry">the logger entry.</param>
 /// <returns>the window list.</returns>
 public Dictionary<string, bool> GetDisplayWindows(LoggerEntry entry)
 {
     Dictionary<string, bool> result = new Dictionary<string, bool>();
     foreach (TraceWindow w in m_winList)
     {
         string name = w.TabText;
         bool isDisplay = w.IsDisplay(entry);
         result.Add(name, isDisplay);
     }
     return result;
 }
Exemplo n.º 20
0
 public void TestLoggerChanged()
 {
     _unitUnderTest.LoggerChangedEvent += new LoggerChangedEventHandler(_unitUnderTest_LoggerChangedEvent);
     LoggerEntry ent = new LoggerEntry("ModelID", "Key", "Process", "FullPN");
     _unitUnderTest.AddLoggerEntry(ent);
     _unitUnderTest.LoggerChanged("FullPN1", ent);
     ent = new LoggerEntry("ModelID", "Key1", "Process", "FullPN1");
     _unitUnderTest.LoggerChanged("FullPN", ent);
 }
Exemplo n.º 21
0
 /// <summary>
 /// Constructors
 /// </summary>
 /// <param name="orgFullPN">the original FullPN</param>
 /// <param name="entry">the logger entry.</param>
 public LoggerEventArgs(string orgFullPN, LoggerEntry entry)
 {
     m_orgFullPN = orgFullPN;
     m_entry = entry;
 }
Exemplo n.º 22
0
 public void TestLoggerRemoved()
 {
     _unitUnderTest.LoggerDeleteEvent += new LoggerDeleteEventHandler(_unitUnderTest_LoggerDeleteEvent);
     LoggerEntry ent = new LoggerEntry("ModelID", "Key", "Process", "FullPN");
     _unitUnderTest.AddLoggerEntry(ent);
     List<string> res = _unitUnderTest.GetLoggerList();
     Assert.AreEqual(1, res.Count, "Add entry is unexpected work.");
     LoggerEntry ent1 = new LoggerEntry("ModelID", "Key", "Process", "FullPN1");
     _unitUnderTest.LoggerRemoved(ent1);
     res = _unitUnderTest.GetLoggerList();
     Assert.AreEqual(1, res.Count, "Remove entry is unexpected work.");
     _unitUnderTest.LoggerRemoved(ent);
     res = _unitUnderTest.GetLoggerList();
     Assert.AreEqual(0, res.Count, "Remove entry is unexpected work.");
     _unitUnderTest.LoggerRemoved(null);
 }
Exemplo n.º 23
0
 public void TestGetter()
 {
     LoggerEntry ent = new LoggerEntry("ModelID", "ID", "Process", "FullPN");
     Assert.AreEqual("orgFullPN", _unitUnderTest.OriginalFullPN, "Original file name is not expected.");
     Assert.AreEqual(ent, _unitUnderTest.Entry, "Entry is not expected");
 }
Exemplo n.º 24
0
 /// <summary>
 /// The event sequence on adding the logger at other plugin.
 /// </summary>
 /// <param name="entry">Logger entry data.</param>
 public virtual void LoggerAdd(LoggerEntry entry)
 {
     // do nothing
 }
Exemplo n.º 25
0
        public void TestSetter()
        {
            LoggerEntry value = null;
            value = new LoggerEntry("Model", "/:ID", "Process", "Process:/:ID:Activity");

            value.ModelID = "Model1";
            Assert.AreEqual("Model1", value.ModelID, "ModelID is not expected value.");

            value.ID = "/:ID1";
            Assert.AreEqual("/:ID1", value.ID, "ID is not expected value.");

            value.Type = "Variable";
            Assert.AreEqual("Variable", value.Type, "Type is not expected value.");

            value.FullPN = "Process:/:ID:Vm";
            Assert.AreEqual("Process:/:ID:Vm", value.FullPN, "FullPN is not expected value.");

            value.Color = Color.Red;
            Assert.AreEqual(value.Color, Color.Red, "Color is not expected value.");

            value.LineStyle = DashStyle.DashDot;
            Assert.AreEqual(value.LineStyle, DashStyle.DashDot, "Line style is not expected value.");

            value.LineWidth = 10;
            Assert.AreEqual(value.LineWidth, 10, "Line width is not expected value.");

            value.IsLoaded = false;
            Assert.AreEqual(false, value.IsLoaded, "IsLogging is not expected value.");

            value.IsShown = false;
            Assert.AreEqual(false, value.IsShown, "IsShown is not expected value.");

            value.IsY2Axis = true;
            Assert.AreEqual(true, value.IsY2Axis, "IsY2 axis is not expected value.");

            value.IsY2AxisInt = 0;
            Assert.AreEqual(false, value.IsY2Axis, "IsY2AxisInt is not expected value.");
            Assert.AreEqual(0, value.IsY2AxisInt, "IsY2AxisInt is not expected value.");

            value.IsY2AxisInt = 1;
            Assert.AreEqual(true, value.IsY2Axis, "IsY2AxisInt is not expected value.");
            Assert.AreEqual(1, value.IsY2AxisInt, "IsY2AxisInt is not expected value.");

            value.IsShowInt = 0;
            Assert.AreEqual(false, value.IsShown, "IsShowInt is not expected value.");
            Assert.AreEqual(0, value.IsShowInt, "IsShowInt is not expected value.");

            value.IsShowInt = 1;
            Assert.AreEqual(true, value.IsShown, "IsShowInt is not expected value.");
            Assert.AreEqual(1, value.IsShowInt, "IsShowInts is not expected value.");

            value.LineStyleInt = 0;
            Assert.AreEqual(value.LineStyle, DashStyle.Solid, "LineStyleInt is not expected value.");
            Assert.AreEqual(value.LineStyleInt, 0, "LineStyleInt is not expected value.");

            value.LineStyleInt = 1;
            Assert.AreEqual(value.LineStyle, DashStyle.Dot, "LineStyleInt is not expected value.");
            Assert.AreEqual(value.LineStyleInt, 1, "LineStyleInt is not expected value.");

            value.LineStyleInt = 2;
            Assert.AreEqual(value.LineStyle, DashStyle.Dash, "LineStyleInt is not expected value.");
            Assert.AreEqual(value.LineStyleInt, 2, "LineStyleInt is not expected value.");

            value.LineStyleInt = 3;
            Assert.AreEqual(value.LineStyle, DashStyle.DashDot, "LineStyleInt is not expected value.");
            Assert.AreEqual(value.LineStyleInt, 3, "LineStyleInt is not expected value.");

            value.LineStyleInt = 4;
            Assert.AreEqual(value.LineStyle, DashStyle.DashDotDot, "LineStyleInt is not expected value.");
            Assert.AreEqual(value.LineStyleInt, 4, "LineStyleInt is not expected value.");

            value.FileName = "aaa";
            Assert.AreEqual("aaa", value.FileName, "Filename is not expected value.");
        }
Exemplo n.º 26
0
 /// <summary>
 /// Add the logger entry.
 /// </summary>
 /// <param name="modelID">the model ID.</param>
 /// <param name="Key">the object key.</param>
 /// <param name="Type">the object type.</param>
 /// <param name="fullPN">the FullPN.</param>
 public void AddLoggerEntry(string modelID, string Key, string Type, string fullPN)
 {
     LoggerEntry entry = new LoggerEntry(modelID, Key, Type, fullPN);
     entry.Color = Util.GetColor(m_count);
     entry.LineStyle = Util.GetLine(m_count);
     m_count++;
     AddLoggerEntry(entry);
 }
Exemplo n.º 27
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
Exemplo n.º 28
0
        /// <summary>
        /// Add the logger entry.
        /// </summary>
        /// <param name="entry">the logger entry.</param>
        public void AddLoggerEntry(LoggerEntry entry)
        {
            if (entry == null) return;
            if (m_loggerList.Contains(entry))
                return;

            m_loggerList.Add(entry);

            if (LoggerAddEvent != null)
            {
                LoggerAddEvent(this, new LoggerEventArgs(entry.FullPN, entry));
            }
        }
Exemplo n.º 29
0
        public void TestEquals()
        {
            bool expectedBoolean = false;
            bool resultBoolean = false;
            LoggerEntry value = null;

            value = new LoggerEntry("Model", "/:ID", "Process", "Process:/:ID:Activity");
            expectedBoolean = false;
            resultBoolean = false;

            resultBoolean = value.Equals(new object());
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");

            resultBoolean = value.Equals(new LoggerEntry("Model1", "/:ID", "Process", "Process:/:ID:Activity"));
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");

            resultBoolean = value.Equals(new LoggerEntry("Model", "/:ID1", "Process", "Process:/:ID:Activity"));
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");

            resultBoolean = value.Equals(new LoggerEntry("Model", "/:ID", "Variable", "Process:/:ID:Activity"));
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");

            resultBoolean = value.Equals(new LoggerEntry("Model1", "/:ID", "Process", "Process:/:ID:Km"));
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");

            expectedBoolean = true;
            resultBoolean = value.Equals(new LoggerEntry("Model", "/:ID", "Process", "Process:/:ID:Activity"));
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");

            resultBoolean = value.Equals(new LoggerEntry("Model", "/:ID", "Process", "Process:/:ID:Activity"));
            Assert.AreEqual(expectedBoolean, resultBoolean, "Equals method returned unexpected result.");
        }
Exemplo n.º 30
0
 /// <summary>
 /// Write the logge elements.
 /// </summary>
 /// <param name="xmlOut">Xml writer object.</param>
 /// <param name="entry">The logger entry.</param>
 private static void WriteLoggerElement(XmlTextWriter xmlOut, LoggerEntry entry)
 {
     xmlOut.WriteStartElement(LemlConstants.xPathLogger);
     xmlOut.WriteAttributeString(LemlConstants.xPathModelID, entry.ModelID);
     xmlOut.WriteAttributeString(LemlConstants.xPathKey, entry.ID);
     xmlOut.WriteAttributeString(LemlConstants.xPathType, entry.Type);
     xmlOut.WriteAttributeString(LemlConstants.xpathFullPN, entry.FullPN);
     xmlOut.WriteAttributeString(LemlConstants.xpathColor, entry.Color.Name);
     xmlOut.WriteAttributeString(LemlConstants.xpathLineStyle, entry.LineStyleInt.ToString());
     xmlOut.WriteAttributeString(LemlConstants.xpathLineWidth, entry.LineWidth.ToString());
     xmlOut.WriteAttributeString(LemlConstants.xpathIsShown, entry.IsShowInt.ToString());
     xmlOut.WriteAttributeString(LemlConstants.xpathIsY2, entry.IsY2AxisInt.ToString());
     xmlOut.WriteEndElement();
 }