-
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.
Minor Updates and added new files to gitignore
- Loading branch information
1 parent
f08837e
commit 9342106
Showing
11 changed files
with
242 additions
and
80 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
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,58 @@ | ||
//using IP_Booking_Overtime; | ||
//using NUnit.Framework; | ||
//using System; | ||
//using System.Collections.Generic; | ||
//using System.Text; | ||
//using Microsoft.EntityFrameworkCore; | ||
//using IP_BusinessLayer; | ||
|
||
//namespace BusinessLayerTesting.MockTests | ||
//{ | ||
|
||
// [TestFixture] | ||
// public class OvertimeManagerShould | ||
// { | ||
// OvertimeManager overtimeManager; | ||
|
||
// [OneTimeSetUp] | ||
// public void OneTimeSetUp() | ||
// { | ||
// var options = new DbContextOptionsBuilder<IndividualProject_DatabaseContext>() | ||
// .UseInMemoryDatabase(databaseName: "IP_DB") | ||
// .Options; | ||
// var context = new IndividualProject_DatabaseContext(options); | ||
// overtimeManager = new OvertimeManager(context); | ||
// overtimeManager.CreateOvertimeList(new List<Overtime> | ||
// { | ||
// new Overtime() {Day = "Monday", StartTime = new TimeSpan(3, 0, 0), NumberOfHours = 3}, | ||
// new Overtime() {Day = "Tuesday", StartTime = new TimeSpan(16, 0, 0), NumberOfHours = 10}, | ||
// new Overtime() { Day = "Tuesday", StartTime = new TimeSpan(13, 0, 0), NumberOfHours = 4}, | ||
// new Overtime() {Day = "Wednesday", StartTime = new TimeSpan(2, 0, 0), NumberOfHours = 6}, | ||
// new Overtime() {Day = "Thursday", StartTime = new TimeSpan(11, 0, 0), NumberOfHours = 8}, | ||
// new Overtime() {Day = "Thursday", StartTime = new TimeSpan(0, 0, 0), NumberOfHours = 7}, | ||
// new Overtime() {Day = "Friday", StartTime = new TimeSpan(23, 0, 0), NumberOfHours = 5}, | ||
// new Overtime() {Day = "Friday", StartTime = new TimeSpan(14, 0, 0), NumberOfHours = 4}, | ||
// new Overtime() {Day = "Friday", StartTime = new TimeSpan(17, 0, 0), NumberOfHours = 6}, | ||
// }); | ||
// } | ||
|
||
// [Test] | ||
// public void GivenAValidOvertime_Returns_AOvertimeObject() | ||
// { | ||
// Assert.That(overtimeManager.GetOvertime(2), Is.InstanceOf<Overtime>()); | ||
// } | ||
|
||
// [Test] | ||
// public void GivenANewOvertime_ItGetsAddedToTheDatabase() | ||
// { | ||
// object item = new Overtime() { Day = "Monday", StartTime = TimeSpan.Parse("18:00"), NumberOfHours = 5 }; | ||
// overtimeManager.GetSelectedOvertime(item); | ||
// Overtime newItem = (Overtime)item; | ||
// overtimeManager.CreateOvertime(newItem.Day, newItem.StartTime.Value, newItem.NumberOfHours.ToString()); | ||
// overtimeManager.GetSelectedOvertime(newItem); | ||
// Assert.That(newItem.StartTime, Is.EqualTo(new TimeSpan(18, 0, 0))); | ||
// Assert.That(newItem.Day, Is.EqualTo("Monday")); | ||
// overtimeManager.RemoveOvertime(newItem); | ||
// } | ||
// } | ||
//} |
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
BusinessLayerTesting/MockTests/Overtime_UserCreatorTests.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Moq; | ||
using IP_BusinessLayer; | ||
using IP_Booking_Overtime; | ||
|
||
namespace BusinessLayerTesting.MockTests | ||
{ | ||
[TestFixture] | ||
public class Overtime_UserCreatorTests | ||
{ | ||
private OvertimeManager _sut; | ||
|
||
[Test] | ||
public void BeAbleToBeConstructed() | ||
{ | ||
_sut = new OvertimeManager(); | ||
Assert.That(_sut, Is.InstanceOf<OvertimeManager>()); | ||
} | ||
|
||
[Test] | ||
public void BeAbleToBeConstructedUsingMoq() | ||
{ | ||
var mockDatabase = new Mock<IndividualProject_DatabaseContext>(); | ||
_sut = new OvertimeManager(mockDatabase.Object); | ||
Assert.That(_sut, Is.InstanceOf<OvertimeManager>()); | ||
} | ||
|
||
[Test] | ||
public void | ||
} | ||
} |
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
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,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace IP_BusinessLayer | ||
{ | ||
public interface IOvertimeUserCreator | ||
{ | ||
//public string Details(string userName, ) | ||
} | ||
} |
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.