1
 [ClassInitialize]
    public static void ReportClassSetup(TestContext context)
    {
        BaseAdapter.ConnectionString = ConfigurationManager.ConnectionStrings["PremierConfig"].ConnectionString;
        IServiceContext serviceContext = new ServiceContextTest();
        var backgroundQueueService = new Camp.Core.Queue.DedicatedThreadTaskQueueService("PremierWebQueueService");
        backgroundQueueService.Start();
        var internalLoggerBackgroundService = new InternalLoggerBackgroundService()
        {
            QueueService = backgroundQueueService
        };
        _service = new InternalService(new DummyAuthorizationManager(), null, null)
        {
            ServiceContext = serviceContext,
            InternalLoggerBackgroundService = internalLoggerBackgroundService
        };
    }

    [TestInitialize]
    public void ReportTestSetup()
    {

    }

    [TestMethod]
    public void GetUserActivityReport1()
    {
       Assert.IsNotNull(_service.GetUserActivityReport(1));
    }

In the above code all the intialization and setup i can do it in classintialize then what is the exact use of TestInitalize?

Nkosi
  • 235,767
  • 35
  • 427
  • 472
Sparrow
  • 355
  • 4
  • 19
  • only definitions are mentioned there, there's no reason? or practical example as to why to go for testinit ? – Sparrow Jan 19 '18 at 01:59

0 Answers0