Esempio n. 1
0
        private static void Main(string[] args)
        {
            ISerializer serializer = new OtusXmlSerializer();

            var game = new Game(serializer);

            IGameObject human = new Human();

            game.AddObject(human);

            game.Save();

            //========================================================
            IApiClientFactory apiClientFactory = new ApiClientFactory();

            IApiClient client1 = apiClientFactory.CreateClient("http://our.api.com");
            IApiClient client2 = apiClientFactory.CreateClient("ws://our.api.com");

            // добавляем логгирование
            client1 = new ApiClientWithLogging(client1);
            client2 = new ApiClientWithLogging(client2);

            // вызываем методы
            client1.SendRequest();
            client2.SendRequest();

            //=============


            IReadRepository <object>  r = new ReadRepository <string>();
            IWriteRepository <string> w = new WriteRepository <object>();
        }
Esempio n. 2
0
        public void Initialize()
        {
            Mapper.Initialize(
            mappingConfig =>
            {
                mappingConfig.AddProfile<CommonProfile>();
            });

            ApiClient = ApiClientFactory.CreateClient();
            _objectContainer.RegisterInstanceAs<IApiClient>(ApiClient);
            if (GetAppData.GetBrowser() != "")
            {
                if (Driver.Instance == null)
                    Driver.Initialize();
                else
                {
                    Driver.Instance.Manage().Cookies.DeleteAllCookies();
                    Driver.GoToBaseUrl();
                }
            }
          


          

            RucPages = new RucPages(Driver.Instance);
            _objectContainer.RegisterInstanceAs<IRuc>(RucPages);

        }