This repository was archived by the owner on Jun 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSystemDateTests.cs
45 lines (37 loc) · 1.62 KB
/
SystemDateTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using GraphLabs.Dal.Ef.Extensions;
using GraphLabs.Dal.Ef.Services;
using GraphLabs.DomainModel;
using GraphLabs.Dal.Ef;
using Moq;
using NUnit.Framework;
namespace GraphLabs.Tests.DomainModel
{
[TestFixture]
public class SystemDateTests : GraphLabsTestBase
{
[Test]
public void TestGetTerm()
{
var systemDateMoq = new Mock<ISystemDateService>();
systemDateMoq.Setup(o => o.GetDate()).Returns(new DateTime(2013, 01, 01));
Assert.AreEqual(Term.Autumn, systemDateMoq.Object.GetTerm());
systemDateMoq.Setup(o => o.GetDate()).Returns(new DateTime(2013, 02, 01));
Assert.AreEqual(Term.Spring, systemDateMoq.Object.GetTerm());
systemDateMoq.Setup(o => o.GetDate()).Returns(new DateTime(2013, 05, 01));
Assert.AreEqual(Term.Spring, systemDateMoq.Object.GetTerm());
systemDateMoq.Setup(o => o.GetDate()).Returns(new DateTime(2013, 08, 01));
Assert.AreEqual(Term.Spring, systemDateMoq.Object.GetTerm());
systemDateMoq.Setup(o => o.GetDate()).Returns(new DateTime(2013, 09, 01));
Assert.AreEqual(Term.Autumn, systemDateMoq.Object.GetTerm());
systemDateMoq.Setup(o => o.GetDate()).Returns(new DateTime(2013, 12, 01));
Assert.AreEqual(Term.Autumn, systemDateMoq.Object.GetTerm());
}
[Test]
public void TestGetDate()
{
var dateService = new SystemDateService(GraphLabsContext);
Assert.DoesNotThrow(() => dateService.GetDate());
}
}
}