public DomainServiceTest(XElement roots)
 {
     proxy       = new ChannelFactory <IDomainWebService>("Cws.Poc.DomainWebService");
     serviceName = proxy.Endpoint.Address.Uri.Segments[proxy.Endpoint.Address.Uri.Segments.Length - 1].Split('.')[0];
     target      = proxy.CreateChannel();
     _writer     = new LogWriter();
     root        = roots;
     _writer.CreateXmlFile(LogSummaryFile, "Summary");
     _writer.CreateXmlFile(LogDetailedFile, "Detailed");
     _writer.LoadLogWriter(LogSummaryFile, LogDetailedFile);
 }
 //Console app callup
 public DomainServiceTest(string reportSummaryPath, string reportDetailedPath, LogWriter _writercls, XElement _rootcls, AssertClass _Assertcls)
 {
     proxy           = new ChannelFactory <IDomainWebService>("Cws.Poc.DomainWebService");
     serviceName     = proxy.Endpoint.Address.Uri.Segments[proxy.Endpoint.Address.Uri.Segments.Length - 1].Split('.')[0];
     target          = proxy.CreateChannel();
     LogSummaryFile  = reportSummaryPath;
     LogDetailedFile = reportDetailedPath;
     _writer         = _writercls;
     _Assert         = _Assertcls;
     // SBWSCommon.EnvironmentLevel = ConfigurationManager.AppSettings["ExecutionEnvironment"];
     //_writer.CreateXmlFile(LogSummaryFile, "Summary");
     //_writer.CreateXmlFile(LogDetailedFile, "Detailed");
     //_writer.LoadLogWriter(LogSummaryFile, LogDetailedFile);
     root = _rootcls;
 }
        public static void MyClassInitialize(TestContext testContext)
        {
            if (isLocalRun)
            {
                proxy           = new ChannelFactory <IDomainWebService>("Cws.Poc.DomainWebService");
                serviceName     = proxy.Endpoint.Address.Uri.Segments[proxy.Endpoint.Address.Uri.Segments.Length - 1].Split('.')[0];
                target          = proxy.CreateChannel();
                refreshProxy    = new ChannelFactory <IRefreshWebService>("Cws.Poc.RefreshWebService");
                refreshService  = refreshProxy.CreateChannel();
                LogSummaryFile  = filePath + DateTime.Now.ToShortDateString().Replace("/", "") + DateTime.Now.ToLongTimeString().Replace(":", "") + "Summary.xml";
                LogDetailedFile = filePath + DateTime.Now.ToShortDateString().Replace("/", "") + DateTime.Now.ToLongTimeString().Replace(":", "") + "Detailed.xml";
                _writer         = new LogWriter();
                _Assert         = new AssertClass(_writer);
                _writer.CreateXmlFile(LogSummaryFile, "Summary");
                _writer.CreateXmlFile(LogDetailedFile, "Detailed");
                _writer.LoadLogWriter(LogSummaryFile, LogDetailedFile);
                root = _writer.create_node("TestCase");
            }
            //_writer.CreateXmlFile(LogSummaryFile, "Summary");
            //_writer.CreateXmlFile(LogDetailedFile, "Detailed");
            //_writer.LoadLogWriter(LogSummaryFile, LogDetailedFile);

            proxy = new ChannelFactory <IDomainWebService>("Cws.Poc.DomainWebService");
            try
            {
                target = proxy.CreateChannel();
            }
            catch (FaultException fault)
            {
                //log.Log("Error Occured  & Fault Exception was Raised. Message :" + fault.Message);
            }
            catch (CommunicationException comm)
            {
                //log.Log("Error Occured & Communication Exception was Raised. Message :" + comm.Message);
            }
        }