forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShipperFactory.cs
More file actions
30 lines (28 loc) · 917 Bytes
/
ShipperFactory.cs
File metadata and controls
30 lines (28 loc) · 917 Bytes
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
using System;
using NUnit.Framework;
namespace ServiceStack.Common.Tests.Models
{
public class ShipperFactory
: ModelFactoryBase<Shipper>
{
public override Shipper CreateInstance(int i)
{
var hex = ((i % 240) + 16).ToString("X");
return new Shipper {
Id = i,
CompanyName = "Shipper" + i,
DateCreated = new DateTime(i + 1 % 3000, (i % 11) + 1, (i % 27) + 1),
ShipperType = (ShipperType)(i % 3),
UniqueRef = new Guid(hex + "D148A5-E5F1-4E5A-8C60-52E5A80ACCC6"),
};
}
public override void AssertIsEqual(Shipper actual, Shipper expected)
{
Assert.That(actual.Id, Is.EqualTo(expected.Id));
Assert.That(actual.CompanyName, Is.EqualTo(expected.CompanyName));
Assert.That(actual.ShipperType, Is.EqualTo(expected.ShipperType));
Assert.That(actual.DateCreated, Is.EqualTo(expected.DateCreated));
Assert.That(actual.UniqueRef, Is.EqualTo(expected.UniqueRef));
}
}
}