This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Oskarowski/dev-task-1-1-ok
Task 1 - 1
- Loading branch information
Showing
12 changed files
with
280 additions
and
243 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -413,4 +413,6 @@ FodyWeavers.xsd | |
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
*.vsix | ||
|
||
test_results.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
37 changes: 0 additions & 37 deletions
37
Library/DataLayer/Implementations/DataFillers/PresetFiller.cs
This file was deleted.
Oops, something went wrong.
158 changes: 0 additions & 158 deletions
158
Library/DataLayer/Implementations/DataFillers/RandomFiller.cs
This file was deleted.
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
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,33 @@ | ||
using DataLayer.API; | ||
using DataLayer.Implementations; | ||
|
||
namespace Tests; | ||
|
||
[TestClass] | ||
public class FillerTests | ||
{ | ||
[TestMethod] | ||
public void PredefinedFillerTests() | ||
{ | ||
IDataContext context = new DataContext(); | ||
IDataFiller filler = new PresetFiller(); | ||
|
||
filler.Fill(context); | ||
|
||
Assert.AreEqual(5, context.Users.Count); | ||
Assert.AreEqual(5, context.Products.Count); | ||
Assert.AreEqual(5, context.States.Count); | ||
Assert.AreEqual(11, context.Events.Count); | ||
} | ||
|
||
[TestMethod] | ||
public void RandomFillerTests(){ | ||
IDataContext context = new DataContext(); | ||
IDataFiller filler = new RandomFiller(); | ||
|
||
filler.Fill(context); | ||
|
||
Assert.ThrowsException<ArgumentException>(() => {RandomFiller.GetRandomNumber<int>(0);}); | ||
Assert.AreEqual(15, RandomFiller.GetRandomString(15).Length); | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
Library/DataLayer/API/IDataFiller.cs → Library/Tests/Seeders/IDataFiller.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,4 +1,6 @@ | ||
namespace DataLayer.API | ||
using DataLayer.API; | ||
|
||
namespace Tests | ||
{ | ||
public interface IDataFiller | ||
{ | ||
|
Oops, something went wrong.