-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensured that essence of corruption makes it to the forum template
- Loading branch information
Showing
9 changed files
with
1,748 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Text; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Moq; | ||
using POEApi.Transport; | ||
using Procurement.ViewModel.Filters; | ||
using Procurement.ViewModel.Filters.ForumExport; | ||
using static POEApi.Model.Tests.UnitTestHelper; | ||
|
||
namespace POEApi.Model.Tests | ||
{ | ||
[TestClass] | ||
public class IFilterTests | ||
{ | ||
private Mock<ITransport> _mockTransport; | ||
private POEModel _model; | ||
private IFilter filter; | ||
|
||
[TestInitialize] | ||
public void TestSetup() | ||
{ | ||
_mockTransport = new Mock<ITransport>(); | ||
_model = new POEModel { Transport = _mockTransport.Object }; | ||
} | ||
|
||
[TestMethod] | ||
public void AreEssencesApplicable() | ||
{ | ||
string fakeStashInfo = Encoding.UTF8.GetString(Files.SampleStashWithRemnantOfCorruption); | ||
filter = new EssenceFilter(); | ||
|
||
using (var stream = GenerateStreamFromString(fakeStashInfo)) | ||
{ | ||
_mockTransport.Setup(m => m.GetStash(0, "", "", false)).Returns(stream); | ||
|
||
var stash = _model.GetStash(0, "", ""); | ||
|
||
Assert.IsNotNull(stash); | ||
|
||
var essences = stash.GetItemsByTab(6); | ||
|
||
Assert.IsTrue(essences.All(x => x is Essence)); | ||
|
||
//All the items, which are essences in the first place, should make it into the forum template | ||
Assert.IsTrue(essences.TrueForAll(filter.Applicable)); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.