From 0929aa23df90bb8d98c4eaa133dd2af729d9cb8c Mon Sep 17 00:00:00 2001 From: Praburaj Date: Sat, 18 Apr 2015 18:03:17 -0700 Subject: [PATCH] Enclosing a bunch of test only code within #if TESTING --- .../compiler/shared/Mocks/Common/CustomStateDataFormat.cs | 6 ++++-- test/E2ETests/compiler/shared/Mocks/Common/Helpers.cs | 6 ++++-- .../Mocks/Facebook/FacebookMockBackChannelHttpHandler.cs | 6 ++++-- .../compiler/shared/Mocks/Facebook/FacebookNotifications.cs | 6 ++++-- .../shared/Mocks/Google/GoogleMockBackChannelHttpHandler.cs | 6 ++++-- .../compiler/shared/Mocks/Google/GoogleNotifications.cs | 6 ++++-- .../MicrosoftAccountMockBackChannelHandler.cs | 6 ++++-- .../Mocks/MicrosoftAccount/MicrosoftAccountNotifications.cs | 6 ++++-- .../shared/Mocks/OpenIdConnect/CustomStringDataFormat.cs | 6 ++++-- .../OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs | 6 ++++-- .../Mocks/OpenIdConnect/OpenIdConnectNotifications.cs | 6 ++++-- .../compiler/shared/Mocks/StartupOpenIdConnectTesting.cs | 4 +++- test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs | 6 ++++-- .../shared/Mocks/Twitter/CustomTwitterStateDataFormat.cs | 6 ++++-- .../Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs | 6 ++++-- .../compiler/shared/Mocks/Twitter/TwitterNotifications.cs | 6 ++++-- 16 files changed, 63 insertions(+), 31 deletions(-) diff --git a/test/E2ETests/compiler/shared/Mocks/Common/CustomStateDataFormat.cs b/test/E2ETests/compiler/shared/Mocks/Common/CustomStateDataFormat.cs index 1b68d8d649..6f3717cae8 100644 --- a/test/E2ETests/compiler/shared/Mocks/Common/CustomStateDataFormat.cs +++ b/test/E2ETests/compiler/shared/Mocks/Common/CustomStateDataFormat.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNet.Authentication; +#if TESTING +using Microsoft.AspNet.Authentication; using Microsoft.AspNet.Http.Authentication; using Newtonsoft.Json; @@ -29,4 +30,5 @@ namespace MusicStore.Mocks.Common return JsonConvert.DeserializeObject(state); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Common/Helpers.cs b/test/E2ETests/compiler/shared/Mocks/Common/Helpers.cs index 73e900e379..98ed129194 100644 --- a/test/E2ETests/compiler/shared/Mocks/Common/Helpers.cs +++ b/test/E2ETests/compiler/shared/Mocks/Common/Helpers.cs @@ -1,4 +1,5 @@ -using System; +#if TESTING +using System; namespace MusicStore.Mocks.Common { @@ -12,4 +13,5 @@ namespace MusicStore.Mocks.Common } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookMockBackChannelHttpHandler.cs b/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookMockBackChannelHttpHandler.cs index 69fce9d1b5..602d7f79d5 100644 --- a/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookMockBackChannelHttpHandler.cs +++ b/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookMockBackChannelHttpHandler.cs @@ -1,4 +1,5 @@ -using System.Net.Http; +#if TESTING +using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Http.Collections; @@ -46,4 +47,5 @@ namespace MusicStore.Mocks.Facebook return await Task.FromResult(response); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookNotifications.cs b/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookNotifications.cs index c42273b26a..2dce0c25c5 100644 --- a/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookNotifications.cs +++ b/test/E2ETests/compiler/shared/Mocks/Facebook/FacebookNotifications.cs @@ -1,4 +1,5 @@ -using System; +#if TESTING +using System; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; @@ -55,4 +56,5 @@ namespace MusicStore.Mocks.Facebook context.Response.Redirect(context.RedirectUri + "&custom_redirect_uri=custom"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Google/GoogleMockBackChannelHttpHandler.cs b/test/E2ETests/compiler/shared/Mocks/Google/GoogleMockBackChannelHttpHandler.cs index 8830a4cb18..7eac67873d 100644 --- a/test/E2ETests/compiler/shared/Mocks/Google/GoogleMockBackChannelHttpHandler.cs +++ b/test/E2ETests/compiler/shared/Mocks/Google/GoogleMockBackChannelHttpHandler.cs @@ -1,4 +1,5 @@ -using System.Net.Http; +#if TESTING +using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -46,4 +47,5 @@ namespace MusicStore.Mocks.Google return response; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Google/GoogleNotifications.cs b/test/E2ETests/compiler/shared/Mocks/Google/GoogleNotifications.cs index fe8dc6bb99..1903a79d77 100644 --- a/test/E2ETests/compiler/shared/Mocks/Google/GoogleNotifications.cs +++ b/test/E2ETests/compiler/shared/Mocks/Google/GoogleNotifications.cs @@ -1,4 +1,5 @@ -using System; +#if TESTING +using System; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; @@ -54,4 +55,5 @@ namespace MusicStore.Mocks.Google context.Response.Redirect(context.RedirectUri + "&custom_redirect_uri=custom"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountMockBackChannelHandler.cs b/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountMockBackChannelHandler.cs index d5fc103148..5614e23e6f 100644 --- a/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountMockBackChannelHandler.cs +++ b/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountMockBackChannelHandler.cs @@ -1,4 +1,5 @@ -using System.Net.Http; +#if TESTING +using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -46,4 +47,5 @@ namespace MusicStore.Mocks.MicrosoftAccount return response; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountNotifications.cs b/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountNotifications.cs index 2402a7a482..ed5afba311 100644 --- a/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountNotifications.cs +++ b/test/E2ETests/compiler/shared/Mocks/MicrosoftAccount/MicrosoftAccountNotifications.cs @@ -1,4 +1,5 @@ -using System; +#if TESTING +using System; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; @@ -55,4 +56,5 @@ namespace MusicStore.Mocks.MicrosoftAccount context.Response.Redirect(context.RedirectUri + "&custom_redirect_uri=custom"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/CustomStringDataFormat.cs b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/CustomStringDataFormat.cs index 2883a51f71..205f81ae04 100644 --- a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/CustomStringDataFormat.cs +++ b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/CustomStringDataFormat.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNet.Authentication; +#if TESTING +using Microsoft.AspNet.Authentication; namespace MusicStore.Mocks.OpenIdConnect { @@ -15,4 +16,5 @@ namespace MusicStore.Mocks.OpenIdConnect return protectedText == "protectedString" ? _capturedNonce : null; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs index ed3172eca8..f853408dfb 100644 --- a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs +++ b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs @@ -1,4 +1,5 @@ -using System.IO; +#if TESTING +using System.IO; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -28,4 +29,5 @@ namespace MusicStore.Mocks.OpenIdConnect return Task.FromResult(response); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectNotifications.cs b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectNotifications.cs index c63419943b..a6c461d624 100644 --- a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectNotifications.cs +++ b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/OpenIdConnectNotifications.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if TESTING +using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Authentication.Notifications; @@ -69,4 +70,5 @@ namespace MusicStore.Mocks.OpenIdConnect await Task.FromResult(0); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs b/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs index b8573b7736..7c59c4148a 100644 --- a/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs +++ b/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs @@ -1,3 +1,4 @@ +#if TESTING using System; using Microsoft.AspNet.Authentication.OpenIdConnect; using Microsoft.AspNet.Authorization; @@ -165,4 +166,5 @@ namespace MusicStore SampleData.InitializeMusicStoreDatabaseAsync(app.ApplicationServices).Wait(); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs b/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs index 60a5f23e16..11220300de 100644 --- a/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs +++ b/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs @@ -1,4 +1,5 @@ -using System; +#if TESTING +using System; using Microsoft.AspNet.Authentication.Facebook; using Microsoft.AspNet.Authentication.Google; using Microsoft.AspNet.Authentication.MicrosoftAccount; @@ -224,4 +225,5 @@ namespace MusicStore SampleData.InitializeMusicStoreDatabaseAsync(app.ApplicationServices).Wait(); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Twitter/CustomTwitterStateDataFormat.cs b/test/E2ETests/compiler/shared/Mocks/Twitter/CustomTwitterStateDataFormat.cs index 3500c676c1..96b2c1407c 100644 --- a/test/E2ETests/compiler/shared/Mocks/Twitter/CustomTwitterStateDataFormat.cs +++ b/test/E2ETests/compiler/shared/Mocks/Twitter/CustomTwitterStateDataFormat.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNet.Authentication; +#if TESTING +using Microsoft.AspNet.Authentication; using Microsoft.AspNet.Authentication.Twitter.Messages; using Newtonsoft.Json; @@ -33,4 +34,5 @@ namespace MusicStore.Mocks.Twitter return JsonConvert.DeserializeObject(state); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs b/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs index 2d0e07e529..902d7354f5 100644 --- a/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs +++ b/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if TESTING +using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Threading; @@ -59,4 +60,5 @@ namespace MusicStore.Mocks.Twitter return response; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterNotifications.cs b/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterNotifications.cs index 6deb764a35..49d6a031a3 100644 --- a/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterNotifications.cs +++ b/test/E2ETests/compiler/shared/Mocks/Twitter/TwitterNotifications.cs @@ -1,4 +1,5 @@ -using System.Linq; +#if TESTING +using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Authentication.Twitter; @@ -48,4 +49,5 @@ namespace MusicStore.Mocks.Twitter context.Response.Redirect(context.RedirectUri + "&custom_redirect_uri=custom"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file