Skip to content

Commit

Permalink
Merge pull request #2056 from SkillsFundingAgency/CON-1619-remove-fea…
Browse files Browse the repository at this point in the history
…ture-toggle

Con 1619 remove feature toggle
  • Loading branch information
narendranogothu authored Apr 29, 2020
2 parents 14de142 + d8873c5 commit 64f88e3
Show file tree
Hide file tree
Showing 50 changed files with 112 additions and 1,304 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
using Moq;
using NUnit.Framework;
using SFA.DAS.Authentication;
using SFA.DAS.Authorization.Services;
using SFA.DAS.EmployerAccounts.Interfaces;
using SFA.DAS.EmployerAccounts.Web.Controllers;
using SFA.DAS.EmployerAccounts.Web.Orchestrators;
using SFA.DAS.EmployerAccounts.Web.ViewModels;

namespace SFA.DAS.EmployerAccounts.Web.UnitTests.Controllers.EmployerTeamControllerTests.WhenHomePageToggleIsEnabled
namespace SFA.DAS.EmployerAccounts.Web.UnitTests.Controllers.EmployerTeamControllerTests
{
public class WhenAgreementToSign
{
private EmployerTeamController _controller;

private Mock<IAuthenticationService> mockAuthenticationService;
private Mock<IAuthorizationService> mockAuthorizationService;
private Mock<IMultiVariantTestingService> mockMultiVariantTestingService;
private Mock<ICookieStorageService<FlashMessageViewModel>> mockCookieStorageService;
private Mock<EmployerTeamOrchestrator> mockEmployerTeamOrchestrator;
Expand All @@ -24,94 +22,36 @@ public class WhenAgreementToSign
public void Arrange()
{
mockAuthenticationService = new Mock<IAuthenticationService>();
mockAuthorizationService = new Mock<IAuthorizationService>();
mockMultiVariantTestingService = new Mock<IMultiVariantTestingService>();
mockCookieStorageService = new Mock<ICookieStorageService<FlashMessageViewModel>>();
mockEmployerTeamOrchestrator = new Mock<EmployerTeamOrchestrator>();
mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.CallToAction")).Returns(false);

_controller = new EmployerTeamController(
mockAuthenticationService.Object,
mockMultiVariantTestingService.Object,
mockCookieStorageService.Object,
mockEmployerTeamOrchestrator.Object,
mockAuthorizationService.Object);
mockEmployerTeamOrchestrator.Object);
}

[Test]
public void ThenTheSignAgreementViewIsReturnedAtRow1Panel1()
{
// Arrange
var model = new AccountDashboardViewModel();
model.PayeSchemeCount = 1;
model.CallToActionViewModel = new CallToActionViewModel
var model = new AccountDashboardViewModel
{
AgreementsToSign = true
};

//Act
var result = _controller.Row1Panel1(model) as PartialViewResult;

//Assert
Assert.IsNotNull(result);
Assert.AreEqual("Empty", (result.Model as dynamic).ViewName);
}

[Test]
public void ThenTheTasksViewIsReturnedAtRow1Panel2()
{
// Arrange
var model = new AccountDashboardViewModel();
model.PayeSchemeCount = 1;
model.CallToActionViewModel = new CallToActionViewModel
{
AgreementsToSign = true
PayeSchemeCount = 1,
CallToActionViewModel = new CallToActionViewModel
{
AgreementsToSign = true
}
};

//Act
var result = _controller.Row1Panel2(model) as PartialViewResult;

//Assert
Assert.IsNotNull(result);
Assert.AreEqual("Tasks", (result.Model as dynamic).ViewName);
}

[Test]
public void ThenTheDashboardViewIsReturnedAtRow2Panel1()
{
// Arrange
var model = new AccountDashboardViewModel();
model.PayeSchemeCount = 1;
model.CallToActionViewModel = new CallToActionViewModel
{
AgreementsToSign = true
};

//Act
var result = _controller.Row2Panel1(model) as PartialViewResult;

//Assert
Assert.IsNotNull(result);
Assert.AreEqual("Dashboard", (result.Model as dynamic).ViewName);
}

[Test]
public void ThenTheEmptyViewIsReturnedAtRow2Panel2()
{
// Arrange
var model = new AccountDashboardViewModel();
model.PayeSchemeCount = 1;
model.CallToActionViewModel = new CallToActionViewModel
{
AgreementsToSign = true
};

//Act
var result = _controller.Row2Panel2(model) as PartialViewResult;
var result = _controller.Row1Panel1(model) as PartialViewResult;

//Assert
Assert.IsNotNull(result);
Assert.AreEqual("Empty", (result.Model as dynamic).ViewName);
Assert.AreEqual("SignAgreement", (result.Model as dynamic).ViewName);
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class WhenIChooseIIfIKnowApprenticehipStartDate
private EmployerTeamController _controller;

private Mock<IAuthenticationService> mockAuthenticationService;
private Mock<IAuthorizationService> mockAuthorizationService;
private Mock<IMultiVariantTestingService> mockMultiVariantTestingService;
private Mock<ICookieStorageService<FlashMessageViewModel>> mockCookieStorageService;
private Mock<EmployerTeamOrchestrator> mockEmployerTeamOrchestrator;
Expand All @@ -25,20 +24,15 @@ public class WhenIChooseIIfIKnowApprenticehipStartDate
public void Arrange()
{
mockAuthenticationService = new Mock<IAuthenticationService>();
mockAuthorizationService = new Mock<IAuthorizationService>();
mockMultiVariantTestingService = new Mock<IMultiVariantTestingService>();
mockCookieStorageService = new Mock<ICookieStorageService<FlashMessageViewModel>>();
mockEmployerTeamOrchestrator = new Mock<EmployerTeamOrchestrator>();

mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.HomePage")).Returns(false);
mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.CallToAction")).Returns(true);

_controller = new EmployerTeamController(
mockAuthenticationService.Object,
mockMultiVariantTestingService.Object,
mockCookieStorageService.Object,
mockEmployerTeamOrchestrator.Object,
mockAuthorizationService.Object);
mockEmployerTeamOrchestrator.Object);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class WhenIChooseIIfIKnowApprenticeshipIsForExistingEmployee
private EmployerTeamController _controller;

private Mock<IAuthenticationService> mockAuthenticationService;
private Mock<IAuthorizationService> mockAuthorizationService;
private Mock<IMultiVariantTestingService> mockMultiVariantTestingService;
private Mock<ICookieStorageService<FlashMessageViewModel>> mockCookieStorageService;
private Mock<EmployerTeamOrchestrator> mockEmployerTeamOrchestrator;
Expand All @@ -25,20 +24,15 @@ public class WhenIChooseIIfIKnowApprenticeshipIsForExistingEmployee
public void Arrange()
{
mockAuthenticationService = new Mock<IAuthenticationService>();
mockAuthorizationService = new Mock<IAuthorizationService>();
mockMultiVariantTestingService = new Mock<IMultiVariantTestingService>();
mockCookieStorageService = new Mock<ICookieStorageService<FlashMessageViewModel>>();
mockEmployerTeamOrchestrator = new Mock<EmployerTeamOrchestrator>();

mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.HomePage")).Returns(false);
mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.CallToAction")).Returns(true);

_controller = new EmployerTeamController(
mockAuthenticationService.Object,
mockMultiVariantTestingService.Object,
mockCookieStorageService.Object,
mockEmployerTeamOrchestrator.Object,
mockAuthorizationService.Object);
mockEmployerTeamOrchestrator.Object);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class WhenIChooseIIfIKnowWhichCourseTheApprenticeWillTake
private EmployerTeamController _controller;

private Mock<IAuthenticationService> mockAuthenticationService;
private Mock<IAuthorizationService> mockAuthorizationService;
private Mock<IMultiVariantTestingService> mockMultiVariantTestingService;
private Mock<ICookieStorageService<FlashMessageViewModel>> mockCookieStorageService;
private Mock<EmployerTeamOrchestrator> mockEmployerTeamOrchestrator;
Expand All @@ -25,20 +24,15 @@ public class WhenIChooseIIfIKnowWhichCourseTheApprenticeWillTake
public void Arrange()
{
mockAuthenticationService = new Mock<IAuthenticationService>();
mockAuthorizationService = new Mock<IAuthorizationService>();
mockMultiVariantTestingService = new Mock<IMultiVariantTestingService>();
mockCookieStorageService = new Mock<ICookieStorageService<FlashMessageViewModel>>();
mockEmployerTeamOrchestrator = new Mock<EmployerTeamOrchestrator>();

mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.HomePage")).Returns(false);
mockAuthorizationService.Setup(m => m.IsAuthorized("EmployerFeature.CallToAction")).Returns(true);

_controller = new EmployerTeamController(
mockAuthenticationService.Object,
mockMultiVariantTestingService.Object,
mockCookieStorageService.Object,
mockEmployerTeamOrchestrator.Object,
mockAuthorizationService.Object);
mockEmployerTeamOrchestrator.Object);
}

[Test]
Expand Down
Loading

0 comments on commit 64f88e3

Please sign in to comment.