Example #1
0
        public void MeAccountsGetTest()
        {
            var client = new GraphApi.Client(accessToken);
            GraphApi.Account account = client.Me.Accounts(10, GraphApi.User.Fields.ID);

            Assert.IsNotNull(account);
            Assert.IsNotNull(account.Data);
        }
Example #2
0
        public void MeGetTest()
        {
            var client = new GraphApi.Client(accessToken);
            GraphApi.User user = client.Me.Get();

            Assert.IsNotNull(user);
            Assert.IsNotNull(user.ID);
            Assert.IsNotNull(user.Name);
        }
Example #3
0
        public void GetUserWithFilterTest()
        {
            var client = new GraphApi.Client(accessToken);
            GraphApi.User user = client.Get<GraphApi.User>(userID, GraphApi.User.Fields.ID);

            Assert.IsNotNull(user);
            Assert.IsNotNull(user.ID);
            Assert.IsNull(user.Name);
        }
Example #4
0
        public void EventsPostTest()
        {
            var client = new GraphApi.Client(accessToken);
            string dateTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd THH:mm:ss-");
            string offset = DateTimeOffset.Now.ToString("HHmm");

            GraphApi.Event result = client.CreateEvent("test event", dateTime + offset);

            Assert.IsNotNull(result);

            bool isIDEmpty = String.IsNullOrEmpty(result.ID);
            Assert.IsFalse(isIDEmpty);
        }