Skip to content

Commit 169eb17

Browse files
committed
Fix more tests
1 parent 7db15ca commit 169eb17

File tree

7 files changed

+171
-188
lines changed

7 files changed

+171
-188
lines changed

src/client/Microsoft.Identity.Client/Internal/Broker/BrokerInteractiveRequestComponent.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public async Task<MsalTokenResponse> FetchTokensAsync(CancellationToken cancella
9393
public static bool IsBrokerRequiredAuthCode(string authCode, out string installationUri)
9494
{
9595
if (authCode.StartsWith(BrokerParameter.AuthCodePrefixForEmbeddedWebviewBrokerInstallRequired, StringComparison.OrdinalIgnoreCase))
96-
//|| authCode.StartsWith(_serviceBundle.Config.RedirectUri, StringComparison.OrdinalIgnoreCase) // TODO: what is this?!
9796
{
9897
installationUri = ExtractAppLink(authCode);
9998
return (installationUri != null);

src/client/Microsoft.Identity.Client/Internal/Requests/DeviceCodeRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private async Task<MsalTokenResponse> WaitForTokenResponseAsync(
8989
}
9090
catch (MsalServiceException ex)
9191
{
92-
// TODO: handle 429 concerns here and back off farther if needed.
92+
// TODO: handle 429 concerns here and back off further if needed.
9393
if (ex.ErrorCode.Equals(OAuth2Error.AuthorizationPending, StringComparison.OrdinalIgnoreCase))
9494
{
9595
await Task.Delay(TimeSpan.FromSeconds(deviceCodeResult.Interval), cancellationToken)

tests/CacheCompat/CommonCache.Test.Unit/CacheExecutionTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ private static async Task<LabUserData> GetPublicAadUserDataAsync()
3131
[AssemblyInitialize]
3232
public static void AssemblyInit(TestContext testContext)
3333
{
34-
// TODO: add other users to the mix
3534
s_labUsers.Add(GetPublicAadUserDataAsync().GetAwaiter().GetResult());
3635
}
3736

tests/Microsoft.Identity.Test.Unit/CacheTests/CacheSerializationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public void TestSerializeMsalAccessTokenCacheItem_WithRefreshOn()
258258
string asJson = item.ToJsonString();
259259
var item2 = MsalAccessTokenCacheItem.FromJsonString(asJson);
260260

261-
AssertAccessTokenCacheItemsAreEqual(item, item2, "123"); // TODO: fix this
261+
AssertAccessTokenCacheItemsAreEqual(item, item2, "123");
262262
}
263263

264264
[TestMethod]

tests/Microsoft.Identity.Test.Unit/CoreTests/WsTrustTests/MexParserTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public void WsTrust2005AddressExtractionTest()
4949
[Description("Mex endpoint fails to resolve")]
5050
public async Task MexEndpointFailsToResolveTestAsync()
5151
{
52-
// TODO: should we move this into a separate test class for WsTrustWebRequestManager?
5352
using (var harness = CreateTestHarness())
5453
{
5554
harness.HttpManager.AddMockHandlerContentNotFound(HttpMethod.Get);

tests/Microsoft.Identity.Test.Unit/Kerberos/KerberosSupplementalTicketManagerTests.cs

Lines changed: 149 additions & 164 deletions
Large diffs are not rendered by default.

tests/Microsoft.Identity.Test.Unit/UtilTests/LinkerTests.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,32 @@
77
using System.Linq;
88
using System.Reflection;
99
using System.Text;
10+
using System.Text.Json.Nodes;
1011
using System.Threading.Tasks;
1112
using Microsoft.Identity.Client;
1213
using Microsoft.VisualStudio.TestTools.UnitTesting;
1314
using NSubstitute;
14-
//TODO bogavril - fix this test
15+
1516
namespace Microsoft.Identity.Test.Unit.UtilTests
1617
{
17-
//[TestClass]
18-
//public class LinkerTests
19-
//{
20-
// [TestMethod]
21-
// public void JsonObjectsArePreserved()
22-
// {
23-
// const string Message = "Please add a [Preserve(AllMembers=true)] attribute to each serializable object to avoid the Xamarin Linker removing this type. Type missing this: ";
24-
// var serializableTypes = typeof(PublicClientApplication).Assembly.GetTypes()
25-
// .Where(
26-
// t => t.GetCustomAttributes(typeof(JsonObjectAttribute), true).Any());
18+
[TestClass]
19+
public class LinkerTests
20+
{
21+
[TestMethod]
22+
public void JsonObjectsArePreserved()
23+
{
24+
const string Message = "Please add a [Preserve(AllMembers=true)] attribute to each serializable object to avoid the Xamarin Linker removing this type. Type missing this: ";
25+
var serializableTypes = typeof(PublicClientApplication).Assembly.GetTypes()
26+
.Where(
27+
t => t.GetCustomAttributes(typeof(JsonObject), true).Any());
2728

28-
// foreach (var serializableType in serializableTypes)
29-
// {
30-
// var preserveAttribute = serializableType.GetCustomAttribute<PreserveAttribute>();
31-
// Assert.IsNotNull(preserveAttribute, Message + serializableType);
32-
// Assert.IsTrue(preserveAttribute.AllMembers, Message + serializableType);
33-
// }
34-
// }
35-
//}
29+
foreach (var serializableType in serializableTypes)
30+
{
31+
var preserveAttribute = serializableType.GetCustomAttribute<PreserveAttribute>();
32+
Assert.IsNotNull(preserveAttribute, Message + serializableType);
33+
Assert.IsTrue(preserveAttribute.AllMembers, Message + serializableType);
34+
}
35+
}
36+
}
3637
}
3738
#endif

0 commit comments

Comments
 (0)