Removed 'TESTING' compiler directive
This commit is contained in:
parent
e94f21ffc2
commit
1ba6608d90
|
|
@ -197,7 +197,7 @@ namespace MusicStore.Areas.Admin.Controllers
|
||||||
return string.Format("album_{0}", id);
|
return string.Format("album_{0}", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TESTING
|
// NOTE: this is used for end to end testing only
|
||||||
//
|
//
|
||||||
// GET: /StoreManager/GetAlbumIdFromName
|
// GET: /StoreManager/GetAlbumIdFromName
|
||||||
// Note: Added for automated testing purpose. Application does not use this.
|
// Note: Added for automated testing purpose. Application does not use this.
|
||||||
|
|
@ -215,6 +215,5 @@ namespace MusicStore.Areas.Admin.Controllers
|
||||||
|
|
||||||
return Content(album.AlbumId.ToString());
|
return Content(album.AlbumId.ToString());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -420,14 +420,13 @@ namespace MusicStore.Controllers
|
||||||
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
|
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
|
||||||
var result = await UserManager.CreateAsync(user);
|
var result = await UserManager.CreateAsync(user);
|
||||||
|
|
||||||
#if TESTING
|
// NOTE: Used for end to end testing only
|
||||||
//Just for automated testing adding a claim named 'ManageStore' - Not required for production
|
//Just for automated testing adding a claim named 'ManageStore' - Not required for production
|
||||||
var manageClaim = info.Principal.Claims.Where(c => c.Type == "ManageStore").FirstOrDefault();
|
var manageClaim = info.Principal.Claims.Where(c => c.Type == "ManageStore").FirstOrDefault();
|
||||||
if (manageClaim != null)
|
if (manageClaim != null)
|
||||||
{
|
{
|
||||||
await UserManager.AddClaimAsync(user, manageClaim);
|
await UserManager.AddClaimAsync(user, manageClaim);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Http.Authentication;
|
using Microsoft.AspNetCore.Http.Authentication;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
@ -41,4 +40,3 @@ namespace MusicStore.Mocks.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#if TESTING
|
using System;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace MusicStore.Mocks.Common
|
namespace MusicStore.Mocks.Common
|
||||||
{
|
{
|
||||||
|
|
@ -14,4 +13,3 @@ namespace MusicStore.Mocks.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -56,4 +55,3 @@ namespace MusicStore.Mocks.Facebook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
|
@ -55,4 +54,3 @@ namespace MusicStore.Mocks.Facebook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -54,4 +53,3 @@ namespace MusicStore.Mocks.Google
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
|
@ -55,4 +54,3 @@ namespace MusicStore.Mocks.Google
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -55,4 +54,3 @@ namespace MusicStore.Mocks.MicrosoftAccount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
|
@ -56,4 +55,3 @@ namespace MusicStore.Mocks.MicrosoftAccount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
|
|
||||||
namespace MusicStore.Mocks.OpenIdConnect
|
namespace MusicStore.Mocks.OpenIdConnect
|
||||||
|
|
@ -28,4 +27,3 @@ namespace MusicStore.Mocks.OpenIdConnect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#if TESTING
|
using System.IO;
|
||||||
using System.IO;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -13,7 +12,7 @@ namespace MusicStore.Mocks.OpenIdConnect
|
||||||
var response = new HttpResponseMessage();
|
var response = new HttpResponseMessage();
|
||||||
|
|
||||||
var basePath = Path.GetFullPath(Path.Combine(
|
var basePath = Path.GetFullPath(Path.Combine(
|
||||||
Directory.GetCurrentDirectory(), "ForTesting", "Mocks","OpenIdConnect"));
|
Directory.GetCurrentDirectory(), "ForTesting", "Mocks", "OpenIdConnect"));
|
||||||
|
|
||||||
if (request.RequestUri.AbsoluteUri == "https://login.windows.net/[tenantName].onmicrosoft.com/.well-known/openid-configuration")
|
if (request.RequestUri.AbsoluteUri == "https://login.windows.net/[tenantName].onmicrosoft.com/.well-known/openid-configuration")
|
||||||
{
|
{
|
||||||
|
|
@ -32,4 +31,3 @@ namespace MusicStore.Mocks.OpenIdConnect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -62,4 +61,3 @@ namespace MusicStore.Mocks.OpenIdConnect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
@ -156,4 +155,3 @@ namespace MusicStore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.AspNetCore.Authentication.OAuth;
|
using Microsoft.AspNetCore.Authentication.OAuth;
|
||||||
using Microsoft.AspNetCore.Authentication.Twitter;
|
using Microsoft.AspNetCore.Authentication.Twitter;
|
||||||
|
|
@ -200,4 +199,3 @@ namespace MusicStore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Authentication.Twitter;
|
using Microsoft.AspNetCore.Authentication.Twitter;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
@ -45,4 +44,3 @@ namespace MusicStore.Mocks.Twitter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -49,4 +48,3 @@ namespace MusicStore.Mocks.Twitter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if TESTING
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
@ -66,4 +65,3 @@ namespace MusicStore.Mocks.Twitter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace MusicStore.Models
|
||||||
await userManager.AddClaimAsync(user, new Claim("ManageStore", "Allowed"));
|
await userManager.AddClaimAsync(user, new Claim("ManageStore", "Allowed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TESTING
|
// NOTE: For end to end testing only
|
||||||
var envPerfLab = configuration["PERF_LAB"];
|
var envPerfLab = configuration["PERF_LAB"];
|
||||||
if (envPerfLab == "true")
|
if (envPerfLab == "true")
|
||||||
{
|
{
|
||||||
|
|
@ -119,7 +119,6 @@ namespace MusicStore.Models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Album[] GetAlbums(string imgUrl, Dictionary<string, Genre> genres, Dictionary<string, Artist> artists)
|
private static Album[] GetAlbums(string imgUrl, Dictionary<string, Genre> genres, Dictionary<string, Artist> artists)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Logging.Console;
|
|
||||||
using MusicStore.Components;
|
using MusicStore.Components;
|
||||||
using MusicStore.Models;
|
using MusicStore.Models;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"define": [
|
"define": [
|
||||||
"DEMO",
|
"DEMO"
|
||||||
"TESTING"
|
|
||||||
],
|
],
|
||||||
"emitEntryPoint": true,
|
"emitEntryPoint": true,
|
||||||
"preserveCompilationContext": true,
|
"preserveCompilationContext": true,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
using System;
|
namespace E2ETests
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace E2ETests
|
|
||||||
{
|
{
|
||||||
public class MusicStoreConfig
|
public class MusicStoreConfig
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue