This repository has been archived by the owner on Dec 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
734 changed files
with
93,845 additions
and
69,917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 49 additions & 46 deletions
95
src/Feature/Demo/tests/Repositories/ReferralRepositoryTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,58 @@ | ||
namespace Sitecore.Feature.Demo.Tests.Repositories | ||
{ | ||
using System.Linq; | ||
using FluentAssertions; | ||
using NSubstitute; | ||
using Ploeh.AutoFixture.Xunit2; | ||
using Sitecore.Analytics; | ||
using Sitecore.Analytics.Tracking; | ||
using Sitecore.Feature.Demo.Models; | ||
using Sitecore.Feature.Demo.Repositories; | ||
using Sitecore.Foundation.Testing.Attributes; | ||
using Xunit; | ||
using System; | ||
using System.Linq; | ||
using System.Web; | ||
using FluentAssertions; | ||
using NSubstitute; | ||
using Ploeh.AutoFixture.Xunit2; | ||
using Sitecore.Analytics; | ||
using Sitecore.Analytics.Tracking; | ||
using Sitecore.Feature.Demo.Models; | ||
using Sitecore.Feature.Demo.Repositories; | ||
using Sitecore.Foundation.Testing.Attributes; | ||
using Xunit; | ||
|
||
public class ReferralRepositoryTests | ||
{ | ||
[Theory] | ||
[AutoDbData] | ||
public void Get_Call_ShouldReturnReferringSite(string site,CurrentInteraction currentInteraction, ITracker tracker, ICampaignRepository campaignRepository, [Greedy]ReferralRepository referralRepository ) | ||
public class ReferralRepositoryTests | ||
{ | ||
//Arrange | ||
tracker.Interaction.Returns(currentInteraction); | ||
tracker.Interaction.ReferringSite.Returns(site); | ||
[Theory] | ||
[AutoDbData] | ||
public void Get_Call_ShouldReturnReferringSite(string site, CurrentInteraction currentInteraction, ITracker tracker, ICampaignRepository campaignRepository, [Greedy] ReferralRepository referralRepository, HttpContext httpContext) | ||
{ | ||
//Arrange | ||
HttpContext.Current = httpContext; | ||
tracker.Interaction.Returns(currentInteraction); | ||
tracker.Interaction.ReferringSite.Returns(site); | ||
|
||
using (new TrackerSwitcher(tracker)) | ||
{ | ||
//Act | ||
var referral = referralRepository.Get(); | ||
//Assert | ||
referral.ReferringSite.Should().Be(site); | ||
} | ||
} | ||
using (new TrackerSwitcher(tracker)) | ||
{ | ||
//Act | ||
var referral = referralRepository.Get(); | ||
//Assert | ||
referral.ReferringSite.Should().Be(site); | ||
} | ||
} | ||
|
||
[Theory] | ||
[AutoDbData] | ||
public void Get_Call_ShouldCombineActiveAndHistoricCampaigns(string site, CurrentInteraction currentInteraction, ITracker tracker, [Frozen]ICampaignRepository campaignRepository, [Greedy]ReferralRepository referralRepository) | ||
{ | ||
//Arrange | ||
tracker.Interaction.Returns(currentInteraction); | ||
tracker.Interaction.ReferringSite.Returns(site); | ||
[Theory] | ||
[AutoDbData] | ||
public void Get_Call_ShouldCombineActiveAndHistoricCampaigns(string site, CurrentInteraction currentInteraction, ITracker tracker, [Frozen] ICampaignRepository campaignRepository, [Greedy] ReferralRepository referralRepository, HttpContext httpContext) | ||
{ | ||
//Arrange | ||
HttpContext.Current = httpContext; | ||
tracker.Interaction.Returns(currentInteraction); | ||
tracker.Interaction.ReferringSite.Returns(site); | ||
|
||
campaignRepository.GetCurrent().Returns(new Campaign() {Title = "camp1"}); | ||
campaignRepository.GetHistoric().Returns(new[] {new Campaign() {Title = "camp2"}, new Campaign() {Title = "camp3"}}); | ||
campaignRepository.GetCurrent().Returns(new Campaign() {Title = "camp1"}); | ||
campaignRepository.GetHistoric().Returns(new[] {new Campaign() {Title = "camp2"}, new Campaign() {Title = "camp3"}}); | ||
|
||
using (new TrackerSwitcher(tracker)) | ||
{ | ||
//Act | ||
var referral = referralRepository.Get(); | ||
//Assert | ||
referral.TotalNoOfCampaigns.Should().Be(3); | ||
referral.Campaigns.Select(x => x.Title).Should().Contain(new[] {"camp1", "camp2", "camp3",}); | ||
} | ||
using (new TrackerSwitcher(tracker)) | ||
{ | ||
//Act | ||
var referral = referralRepository.Get(); | ||
//Assert | ||
referral.TotalNoOfCampaigns.Should().Be(3); | ||
referral.Campaigns.Select(x => x.Title).Should().Contain(new[] {"camp1", "camp2", "camp3",}); | ||
} | ||
} | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/Foundation/Theming/code/bower_components/ace-builds/ChangeLog.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
<meta name="author" content="Fabian Jakobs"> | ||
<!-- | ||
Ace | ||
version 1.2.5 | ||
version 1.2.6 | ||
commit | ||
--> | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/Foundation/Theming/code/bower_components/ace-builds/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Foundation/Theming/code/bower_components/ace-builds/src-min-noconflict/ace.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Foundation/Theming/code/bower_components/ace-builds/src-min-noconflict/ext-emmet.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ndation/Theming/code/bower_components/ace-builds/src-min-noconflict/ext-language_tools.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Foundation/Theming/code/bower_components/ace-builds/src-min-noconflict/ext-modelist.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.