Exemplo n.º 1
0
        /// <summary>
        /// Sync with services.
        /// Sync can be started, if there is no other operations 
        /// (property IsAnyOperation == false)
        /// </summary>
        public async void StartSync(int start)
        {
            try
            {
                if (OnSyncServiceNumber == -1)
                {
                    OnSyncServiceNumber = start;

                    //set connector
                    BaseConnector connector = null;
                    switch (Services[OnSyncServiceNumber].ServerName)
                    {
                        case "google":
                            connector = new GoogleCalendarConnector(Services[OnSyncServiceNumber].DateStart,
                                                                    Services[OnSyncServiceNumber].Period);
                            break;
                        case "facebook": /*connector = new FacebookConnector(Services[OnSyncServiceNumber].Period);*/ break;
                        case "outlook": break;
                        case "vk": break;
                        default: break;
                    }

                    //do sync
                    await connector.GetHolidayList();
                }
            }
            catch { }
        }
Exemplo n.º 2
0
        public void CanGetData()
        {
            //arrange
            GoogleCalendarConnector conn = new GoogleCalendarConnector();

            //act
            var collection = conn.GetHolidayList();

            //assert
            Assert.IsNotNull(collection);

        }