Created
September 24, 2012 11:26
-
-
Save pshomov/3775524 to your computer and use it in GitHub Desktop.
Example of creating a fylgibréf
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
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
using Test.Support; | |
using Test.Support.FlytjandiServices; | |
namespace fylgibref.AcceptanceTests.CreateFylgibref | |
{ | |
[TestFixture] | |
public class CreatedFylgibrefMatchesSubmittedInfo : ConfiguredCreateFylgibrefTestBase | |
{ | |
DateTime the_future; | |
string barcode; | |
public CreatedFylgibrefMatchesSubmittedInfo() | |
{ | |
the_future = DateTime.Now.AddDays(1); | |
} | |
protected override void When() | |
{ | |
long fylgibrefId = new Random().Next(Int32.MaxValue); | |
barcode = "TEST" + new Random().Next(1000, 10000000); | |
var shipmentInfo = new ShipmentInfo | |
{ | |
NumberOfPackages = 1, | |
RefId = fylgibrefId, | |
Sender = | |
new ShippingInfo | |
{ | |
Address = | |
new Location | |
{Zip = 101, StreetNr = "Laugavegur", Phone = "5665454"}, | |
Name = "Sprettur", | |
SSN = "5505071960", | |
}, | |
Receiver = | |
new ShippingInfo | |
{ | |
Address = | |
new Location | |
{Zip = 600, StreetNr = "Laugavegur", Phone = "3445656"}, | |
Name = "Petar Shomov", | |
SSN = "1805762589" | |
}, | |
Payer = | |
new BillingAccount | |
{ | |
Address = new Location {Zip = 101, StreetNr = "Laugavegur"}, | |
Name = "Sprettur", | |
SSN = "5505071960" | |
}, | |
Description = "vorur", | |
Handling = GoodsHandling.CoolGoods, | |
Volume = 43.2f, | |
Weight = 2.3f, | |
DeliveryDate = the_future, | |
Packages = new[]{new Package {Barcode = barcode}, } | |
}; | |
fylgibrefInfo = CreateNewFylgibref(shipmentInfo); | |
} | |
// .... testing things here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment