Exemplo n.º 1
0
        public void StepFinishedEventAfterStepFailureEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var ssevt = new StepStartedEvent("step1");

            _lifecycle.Fire(ssevt);
            var sfevt = new StepFailureEvent
            {
                Throwable = new NullReferenceException("other exception")
            };

            _lifecycle.Fire(sfevt);
            var evt = new StepFinishedEvent();

            _lifecycle.Fire(evt);
            Assert.AreEqual(1, _lifecycle.StepStorage.Get().Last.Value.steps.Length);
            Assert.AreEqual("step1", _lifecycle.StepStorage.Get().Last.Value.steps[0].name);
            Assert.AreEqual(status.broken, _lifecycle.StepStorage.Get().Last.Value.steps[0].status);
            Assert.AreNotEqual(0, _lifecycle.StepStorage.Get().Last.Value.steps[0].stop);
        }
Exemplo n.º 2
0
        public void MultipleStepsTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            _lifecycle.Fire(new StepStartedEvent("step1"));
            _lifecycle.Fire(new StepFinishedEvent());

            Assert.AreEqual(1, _lifecycle.StepStorage.Get().Last.Value.steps.Length);
            Assert.AreEqual("step1", _lifecycle.StepStorage.Get().Last.Value.steps[0].name);
            Assert.AreEqual(status.passed, _lifecycle.StepStorage.Get().Last.Value.steps[0].status);
            Assert.AreNotEqual(0, _lifecycle.StepStorage.Get().Last.Value.steps[0].stop);

            _lifecycle.Fire(new StepStartedEvent("step2"));
            _lifecycle.Fire(new StepFailureEvent());
            _lifecycle.Fire(new StepFinishedEvent());

            Assert.AreEqual(2, _lifecycle.StepStorage.Get().Last.Value.steps.Length);
            Assert.AreEqual("step2", _lifecycle.StepStorage.Get().Last.Value.steps[1].name);
            Assert.AreEqual(status.broken, _lifecycle.StepStorage.Get().Last.Value.steps[1].status);
            Assert.AreNotEqual(0, _lifecycle.StepStorage.Get().Last.Value.steps[1].stop);

            _lifecycle.Fire(new StepStartedEvent("step3"));
            _lifecycle.Fire(new StepFinishedEvent());

            Assert.AreEqual(3, _lifecycle.StepStorage.Get().Last.Value.steps.Length);
            Assert.AreEqual("step3", _lifecycle.StepStorage.Get().Last.Value.steps[2].name);
            Assert.AreEqual(status.passed, _lifecycle.StepStorage.Get().Last.Value.steps[2].status);
            Assert.AreNotEqual(0, _lifecycle.StepStorage.Get().Last.Value.steps[2].stop);
        }
Exemplo n.º 3
0
        public void TestCaseAttributesTest()
        {
            var evt     = new TestCaseStartedEvent("1", "testcase with title");
            var manager = new AttributeManager(new List <Attribute>
            {
                new AllureTitleAttribute("Awesome title"),
                new AllureDescriptionAttribute("Awesome description", descriptiontype.text),
                new AllureSeverityAttribute(severitylevel.critical),
                new AllureFeaturesAttribute("Awesome feature", "Another awesome feature", "Awesome feature2", "New awesome feature"),
                new AllureStoriesAttribute("Awesome story", "Another awesome story", "Awesome story2", "New awesome story")
            });

            manager.Update(evt);
            Assert.AreEqual("Awesome title", evt.Title);
            Assert.AreEqual("Awesome description", evt.Description.Value);
            Assert.AreEqual(descriptiontype.text, evt.Description.type);
            Assert.AreEqual("severity", evt.Labels[0].name);
            Assert.AreEqual("critical", evt.Labels[0].value);
            Assert.AreEqual("feature", evt.Labels[1].name);
            Assert.AreEqual("Awesome feature", evt.Labels[1].value);
            Assert.AreEqual("feature", evt.Labels[2].name);
            Assert.AreEqual("Another awesome feature", evt.Labels[2].value);
            Assert.AreEqual("feature", evt.Labels[3].name);
            Assert.AreEqual("Awesome feature2", evt.Labels[3].value);
            Assert.AreEqual("feature", evt.Labels[4].name);
            Assert.AreEqual("New awesome feature", evt.Labels[4].value);
            Assert.AreEqual("story", evt.Labels[5].name);
            Assert.AreEqual("Awesome story", evt.Labels[5].value);
            Assert.AreEqual("story", evt.Labels[6].name);
            Assert.AreEqual("Another awesome story", evt.Labels[6].value);
            Assert.AreEqual("story", evt.Labels[7].name);
            Assert.AreEqual("Awesome story2", evt.Labels[7].value);
            Assert.AreEqual("story", evt.Labels[8].name);
            Assert.AreEqual("New awesome story", evt.Labels[8].value);
        }
 /// <summary>
 /// Updates TestCaseStartedEvent based on attributes.
 /// <see cref="AllureCSharpCommons.Attributes"/>
 /// </summary>
 public void Update(TestCaseStartedEvent evt)
 {
     _attributes.ForEach(x =>
     {
         if (x.GetType() == typeof(AllureTitleAttribute))
         {
             var attr  = (AllureTitleAttribute)x;
             evt.Title = attr.Value;
         }
         else if (x.GetType() == typeof(AllureDescriptionAttribute))
         {
             var attr        = (AllureDescriptionAttribute)x;
             evt.Description = attr.Value;
         }
         else if (x.GetType() == typeof(AllureStoriesAttribute))
         {
             var attr   = (AllureStoriesAttribute)x;
             evt.Labels = ArraysUtils.AddLabels(evt.Labels, "story", attr.Stories);
         }
         else if (x.GetType() == typeof(AllureFeaturesAttribute))
         {
             var attr   = (AllureFeaturesAttribute)x;
             evt.Labels = ArraysUtils.AddLabels(evt.Labels, "feature", attr.Features);
         }
         else if (x.GetType() == typeof(AllureSeverityAttribute))
         {
             var attr   = (AllureSeverityAttribute)x;
             evt.Labels = ArraysUtils.AddLabel(evt.Labels, "severity", attr.Value);
         }
     });
 }
        public void MultipleTestCasesTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);

            var evt = new TestCaseStartedEvent(SuiteUid, "test name1");

            _lifecycle.Fire(evt);
            _lifecycle.Fire(new TestCaseCanceledEvent());
            _lifecycle.Fire(new TestCaseFinishedEvent());

            Assert.IsNull(_lifecycle.TestCaseStorage.Value);
            Assert.AreEqual(1, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases.Length);
            Assert.AreEqual("test name1", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].name);
            Assert.AreEqual(status.canceled, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("Test skipped with unknown reason",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].attachments);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].steps);
            Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].stop);

            var evt1 = new TestCaseStartedEvent(SuiteUid, "test name2");

            _lifecycle.Fire(evt1);
            _lifecycle.Fire(new TestCasePendingEvent());
            _lifecycle.Fire(new TestCaseFinishedEvent());

            Assert.IsNull(_lifecycle.TestCaseStorage.Value);
            Assert.AreEqual(2, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases.Length);
            Assert.AreEqual("test name2", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[1].name);
            Assert.AreEqual(status.pending, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[1].status);
            Assert.AreEqual("Test not implemented yet",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[1].failure.message);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[1].attachments);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[1].steps);
            Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[1].stop);

            var evt2 = new TestCaseStartedEvent(SuiteUid, "test name3");

            _lifecycle.Fire(evt2);
            _lifecycle.Fire(new TestCaseFailureEvent());
            _lifecycle.Fire(new TestCaseFinishedEvent());

            Assert.IsNull(_lifecycle.TestCaseStorage.Value);
            Assert.AreEqual(3, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases.Length);
            Assert.AreEqual("test name3", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[2].name);
            Assert.AreEqual(status.broken, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[2].status);
            Assert.AreEqual("Test broken with unknown reason",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[2].failure.message);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[2].attachments);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[2].steps);
            Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[2].stop);
        }
Exemplo n.º 6
0
        public void TestCaseTitleAttributeTest()
        {
            var evt     = new TestCaseStartedEvent("1", "testcase with title");
            var manager = new AttributeManager(new List <Attribute>
            {
                new AllureTitleAttribute("Awesome title")
            });

            manager.Update(evt);
            Assert.AreEqual("Awesome title", evt.Title);
        }
Exemplo n.º 7
0
        public void StartTestCase(FeatureInfo featureInfo, ScenarioInfo scenarioInfo)
        {
            var featureUid = GetTestSuiteIdForCurrentThread(featureInfo);

            TestCaseStartedEvent testCaseStarted = new TestCaseStartedEvent(featureUid, scenarioInfo.GetHashCode().ToString(), DateTime.Now)
            {
                Title  = scenarioInfo.Title,
                Labels = GetScenarioLabels(featureInfo, scenarioInfo)
            };

            lifecycle.Fire(testCaseStarted);
        }
Exemplo n.º 8
0
        public void TestCaseSeverityAttributeTest()
        {
            var evt     = new TestCaseStartedEvent("1", "testcase with severity");
            var manager = new AttributeManager(new List <Attribute>
            {
                new AllureSeverityAttribute(severitylevel.critical)
            });

            manager.Update(evt);
            Assert.AreEqual("severity", evt.Labels[0].name);
            Assert.AreEqual("critical", evt.Labels[0].value);
        }
Exemplo n.º 9
0
        public void TestCaseStroiesAttributeTest()
        {
            var evt     = new TestCaseStartedEvent("1", "testcase with title");
            var manager = new AttributeManager(new List <Attribute>
            {
                new AllureStoriesAttribute("Awesome story")
            });

            manager.Update(evt);
            Assert.AreEqual("story", evt.Labels[0].name);
            Assert.AreEqual("Awesome story", evt.Labels[0].value);
        }
Exemplo n.º 10
0
        public void TestCaseDescriptionAttributeTest()
        {
            var evt     = new TestCaseStartedEvent("1", "testcase with description");
            var manager = new AttributeManager(new List <Attribute>
            {
                new AllureDescriptionAttribute("Awesome description", descriptiontype.text)
            });

            manager.Update(evt);
            Assert.AreEqual("Awesome description", evt.Description.Value);
            Assert.AreEqual(descriptiontype.text, evt.Description.type);
        }
        public void TestCaseCanceledEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCaseCanceledEvent();

            _lifecycle.Fire(evt);
            Assert.AreEqual(status.canceled, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("Test skipped with unknown reason",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
        }
        public void TestCaseFailureWithoutExceptionEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCaseFailureEvent();

            _lifecycle.Fire(evt);
            Assert.AreEqual(status.broken, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("Test broken with unknown reason",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
        }
        public void TestCaseStartedEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var evt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(evt);
            Assert.AreEqual(true, _lifecycle.TestCaseStorage.IsValueCreated);
            Assert.AreEqual("test name", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].name);
            Assert.AreEqual(status.passed, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.IsNull(_lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].steps);
            Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].start);
            Assert.AreEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].stop);
        }
Exemplo n.º 14
0
        public void StepStartedEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new StepStartedEvent("step1");

            _lifecycle.Fire(evt);
            Assert.AreEqual(2, _lifecycle.StepStorage.Get().Count); //Root step + step1
            Assert.AreEqual("step1", _lifecycle.StepStorage.Get().Last.Value.name);
            Assert.AreNotEqual(0, _lifecycle.StepStorage.Get().Last.Value.start);
            Assert.AreEqual(0, _lifecycle.StepStorage.Get().Last.Value.stop);
        }
        public void TestCasePendingEventWithoutMessageWithoutExceptionTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCasePendingEvent();

            _lifecycle.Fire(evt);
            Assert.AreEqual(status.pending, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("Test not implemented yet",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
            Assert.IsNull(_lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.stacktrace);
        }
        public void TestCaseFailureWithOtherExceptionEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCaseFailureEvent
            {
                Throwable = new NullReferenceException("null reference exception")
            };

            _lifecycle.Fire(evt);
            Assert.AreEqual(status.broken, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("null reference exception",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
        }
        public void TestCaseFinishedEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCaseFinishedEvent();

            _lifecycle.Fire(evt);
            Assert.IsNull(_lifecycle.TestCaseStorage.Value);
            Assert.AreEqual(1, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases.Length);
            Assert.AreEqual("test name", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].name);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].attachments);
            Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].steps);
            Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].stop);
        }
Exemplo n.º 18
0
        public void StepFinishedEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var ssevt = new StepStartedEvent("step1");

            _lifecycle.Fire(ssevt);
            var evt = new StepFinishedEvent();

            _lifecycle.Fire(evt);
            Assert.AreEqual(1, _lifecycle.StepStorage.Get().Last.Value.steps.Length);
            Assert.AreEqual("step1", _lifecycle.StepStorage.Get().Last.Value.steps[0].name);
            Assert.AreEqual(status.passed, _lifecycle.StepStorage.Get().Last.Value.steps[0].status);
            Assert.AreNotEqual(0, _lifecycle.StepStorage.Get().Last.Value.steps[0].stop);
        }
        public void TestCasePendingEventWithoutMessageWithExceptionTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCasePendingEvent
            {
                Throwable = new Exception("exception")
            };

            _lifecycle.Fire(evt);
            Assert.AreEqual(status.pending, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("exception", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
            Assert.AreEqual("There is no stack trace",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.stacktrace);
        }
Exemplo n.º 20
0
        public void StepFailureEventWithOtherExceptionTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var ssevt = new StepStartedEvent("step1");

            _lifecycle.Fire(ssevt);
            var evt = new StepFailureEvent
            {
                Throwable = new NullReferenceException("other exception")
            };

            _lifecycle.Fire(evt);
            Assert.AreEqual(2, _lifecycle.StepStorage.Get().Count); //Root step + step1
            Assert.AreEqual(status.broken, _lifecycle.StepStorage.Get().Last.Value.status);
        }
        public void TestCaseFailureWithAssertionExceptionAndStackTraceEventTest()
        {
            _lifecycle = Allure.DefaultLifecycle;
            var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42");

            _lifecycle.Fire(tsevt);
            var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name");

            _lifecycle.Fire(tcsevt);
            var evt = new TestCaseFailureEvent
            {
                Throwable  = new AssertionException("assertion exception"),
                StackTrace = "stack trace"
            };

            _lifecycle.Fire(evt);
            Assert.AreEqual(status.failed, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status);
            Assert.AreEqual("assertion exception",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message);
            Assert.AreEqual("stack trace",
                            _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.stacktrace);
        }
Exemplo n.º 22
0
        public override void TestStarted(TestName testName)
        {
            try
            {
                string assembly = testName.FullName.Split('.')[0];
                string clazz    = testName.FullName.Split('(')[0].Split('.')[testName.FullName.Split('(')[0].Split('.').Count() - 2];

                var evt = new TestCaseStartedEvent((string)SuiteStorage[SuiteStorage.Count - 1], testName.FullName);

                foreach (
                    Assembly asm in AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.Contains(assembly)))
                {
                    foreach (Type type in asm.GetTypes().Where(x => x.Name.Contains(clazz)))
                    {
                        string name = !testName.Name.Contains("(")
                            ? testName.Name
                            : testName.Name.Substring(0, testName.Name.IndexOf('('));

                        MethodInfo methodInfo = type.GetMethod(name);
                        if (methodInfo == null)
                        {
                            continue;
                        }
                        var manager =
                            new AttributeManager(methodInfo.GetCustomAttributes(false).OfType <Attribute>().ToList());
                        manager.Update(evt);
                    }
                }

                _lifecycle.Fire(evt);
            }
            catch (Exception e)
            {
                Logger.Error(String.Format("Exception in TestStarted {0}", testName), e);
            }
        }
Exemplo n.º 23
0
        public void OnTestEvent(string report)
        {
            Logger.Info($"{report}");

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(report);
            var eventType = xmlDoc.DocumentElement;

            using (StreamWriter file =
                       new StreamWriter("WriteLines2.txt", true))
            {
                file.WriteLine(report);
            }
            switch (eventType.Name)
            {
            case "start-suite":
                //Console.WriteLine($"***test-run started: {eventType.InnerText}");
                var suiteFullName = eventType.GetAttribute("name");
                //var suiteFullName = eventType.GetAttribute("fullname");
                //var suiteID = eventType.GetAttribute("id");
                string suiteUid = Guid.NewGuid().ToString();

                string assembly = suiteFullName.Split('.')[0];
                string clazz    = suiteFullName.Split('.')[suiteFullName.Split('.').Length - 1];

                var testSuiteStartedEvt = new TestSuiteStartedEvent(suiteUid, suiteFullName);

                foreach (
                    Assembly asm in AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.Contains(assembly)))
                {
                    foreach (Type type in asm.GetTypes().Where(x => x.Name.Contains(clazz)))
                    {
                        var manager = new AttributeManager(type.GetCustomAttributes(false).OfType <Attribute>().ToList());
                        manager.Update(testSuiteStartedEvt);
                    }
                }
                Logger.Info($"Adding suite '{suiteFullName}' with '{suiteUid}' to SuiteStorage");
                SuiteStorage.Add(suiteFullName, suiteUid);
                _lifecycle.Fire(testSuiteStartedEvt);
                break;

            case "start-test":

                try
                {
                    //Console.WriteLine($"***test started: {eventType.GetAttribute("name")}, id: {eventType.GetAttribute("id")}, parentId: {eventType.GetAttribute("parentId")}");
                    var testFullName = eventType.GetAttribute("fullname");
                    var testName     = eventType.GetAttribute("name");


                    string assembly2 = testFullName.Split('.')[0];
                    string clazz2    = testFullName.Split('(')[0].Split('.')[testFullName.Split('(')[0].Split('.').Count() - 2];

                    var testStartedEvt = new TestCaseStartedEvent((string)SuiteStorage[SuiteStorage.Count - 1], testFullName);

                    foreach (
                        Assembly asm in AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.Contains(assembly2)))
                    {
                        foreach (Type type in asm.GetTypes().Where(x => x.Name.Contains(clazz2)))
                        {
                            string name = !testName.Contains("(")
                                    ? testName
                                    : testName.Substring(0, testName.IndexOf('('));

                            MethodInfo methodInfo = type.GetMethod(name);
                            if (methodInfo == null)
                            {
                                continue;
                            }
                            var manager =
                                new AttributeManager(methodInfo.GetCustomAttributes(false).OfType <Attribute>().ToList());
                            manager.Update(testStartedEvt);
                        }
                    }

                    _lifecycle.Fire(testStartedEvt);
                }
                catch (Exception ex)
                {
                    Logger.Error($"{ex.Message} - {ex.StackTrace}");
                }



                break;

            case "test-case":
                switch (eventType.GetAttribute("result"))
                {
                case "Passed":
                    Logger.Info($"Test Passed: {eventType.GetAttribute("name")}");
                    var testFinishedEvt = new TestCaseFinishedEvent();
                    _lifecycle.Fire(testFinishedEvt);
                    break;

                case "Failed":
                {
                    Logger.Info($"Test Failed: {eventType.GetAttribute("name")}");
                    try
                    {
                        _lifecycle.Fire(new TestCaseFailureEvent
                            {
                                Throwable  = new Exception(eventType["failure"]?["message"]?.InnerText),
                                StackTrace = eventType["failure"]?["stack-trace"]?.InnerText
                            });
                        _lifecycle.Fire(new TestCaseFinishedEvent());
                    }
                    catch (Exception ex)
                    {
                        Logger.Error($"{ex.Message} - {ex.StackTrace}");
                    }
                }
                break;
                }
                break;

            case "test-suite":
                var suiteFullName2      = eventType.GetAttribute("name");
                var suiteUidFromStorage = (string)SuiteStorage[suiteFullName2];
                if (suiteUidFromStorage != null)
                {
                    var testSuiteFinishedEvt = new TestSuiteFinishedEvent(suiteUidFromStorage);
                    try
                    {
                        _lifecycle.Fire(testSuiteFinishedEvt);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error($"{ex.Message} - {ex.StackTrace}");
                    }

                    SuiteStorage.Remove(suiteFullName2);
                }
                else
                {
                    Logger.Warn($"{suiteFullName2} - suite not present in storage");
                }
                break;

            default:

                break;
            }
        }