1- using System ;
1+ using System ;
22using Microsoft . VisualStudio . TestTools . UnitTesting ;
33using System . Collections . Generic ;
44using System . IO ;
5- using System . Threading . Tasks ;
5+ using Async = System . Threading . Tasks ;
66
77namespace Microsoft . Graph . Test . Requests . Functional
88{
@@ -11,7 +11,7 @@ namespace Microsoft.Graph.Test.Requests.Functional
1111 public class DeltaQueryTests : GraphTestBase
1212 {
1313 [ TestMethod ]
14- public async System . Threading . Tasks . Task DeltaLinkDriveItem ( )
14+ public async Async . Task DeltaLinkDriveItem ( )
1515 {
1616 try
1717 {
@@ -24,7 +24,7 @@ public async System.Threading.Tasks.Task DeltaLinkDriveItem()
2424 driveItemDeltaCollectionPage = await driveItemDeltaCollectionPage . NextPageRequest . GetAsync ( ) ;
2525 }
2626
27- // At this point we're up to date. driveItemDeltaCollectionPage now has a deltalink.
27+ // At this point we're up to date. messagesDeltaCollectionPage now has a deltalink.
2828 object deltaLink ;
2929
3030 // Now let's use the deltalink to make sure there aren't any changes. There shouldn't be.
@@ -67,6 +67,57 @@ public async System.Threading.Tasks.Task DeltaLinkDriveItem()
6767 }
6868 }
6969
70+ // TODO: Before enabling these tests, we need to cleanup our test data.
71+
72+ //[TestMethod]
73+ //public async Async.Task DeltaLinkMessages()
74+ //{
75+ // try
76+ // {
77+ // // Get our first delta page.
78+ // var messagesDeltaCollectionPage = await graphClient.Me.MailFolders["inbox"].Messages.Delta().Request().GetAsync();
79+
80+ // // Go through all of the delta pages so that we can get the delta link on the last page.
81+ // while (messagesDeltaCollectionPage.NextPageRequest != null)
82+ // {
83+ // messagesDeltaCollectionPage = await messagesDeltaCollectionPage.NextPageRequest.GetAsync();
84+ // }
85+
86+ // // At this point we're up to date. messagesDeltaCollectionPage now has a deltalink.
87+ // object deltaLink;
88+
89+ // // Now let's use the deltalink to make sure there aren't any changes. There shouldn't be.
90+ // if (messagesDeltaCollectionPage.AdditionalData.TryGetValue("@odata.deltaLink", out deltaLink))
91+ // {
92+ // messagesDeltaCollectionPage.InitializeNextPageRequest(graphClient, deltaLink.ToString());
93+ // messagesDeltaCollectionPage = await messagesDeltaCollectionPage.NextPageRequest.GetAsync();
94+ // }
95+ // Assert.IsNotNull(deltaLink, "We did not get a deltalink back as expected.");
96+ // Assert.AreEqual(messagesDeltaCollectionPage.Count, 0, "We received an unexpected change.");
97+
98+ // // Create a new message.
99+ // //CreateNewMessage();
100+
101+ // // Now let's use the deltalink to make sure there aren't any changes. We expect to see a new message.
102+ // if (messagesDeltaCollectionPage.AdditionalData.TryGetValue("@odata.deltaLink", out deltaLink))
103+ // {
104+ // messagesDeltaCollectionPage.InitializeNextPageRequest(graphClient, deltaLink.ToString());
105+ // messagesDeltaCollectionPage = await messagesDeltaCollectionPage.NextPageRequest.GetAsync();
106+ // }
107+
108+ // // We expect two changes, one new item, and the root folder will have a change.
109+ // Assert.AreEqual(messagesDeltaCollectionPage.Count, 2, "We didn't receive the expected change.");
110+ // }
111+ // catch (Microsoft.Graph.ServiceException e)
112+ // {
113+ // Assert.Inconclusive("Error code: {0}", e.Error.Code);
114+ // }
115+
116+ // catch (Exception e)
117+ // {
118+ // Assert.Inconclusive("Error code: {0}", e.Message);
119+ // }
120+ //}
70121
71122 //[TestMethod]
72123 //public async System.Threading.Tasks.Task UserDeltaLink()
0 commit comments