jeudi 29 janvier 2015

Noda Time Unit Testing XML Error

I am trying to setup a simple unit test using Noda Time. My code is:



public void ValidityPassedDate()
{
FakeClock fakeClock = new FakeClock(SystemClock.Instance.Now);
fakeClock.AdvanceDays(60);
MyClass myObj = new MyClass(fakeClock);
myObj.Validity = "1";
myObj.Date = SystemClock.Instance.Now.InZone(DateTimeZoneProviders.Tzdb.GetSystemDefault()).LocalDateTime.Date;

Assert.IsTrue(myObj.ValidityIsValid);
}


But I get this error when I try to build the test:



error CS0012: The type 'System.Xml.Serialization.IXmlSerializable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=----------(I erased this on purpose)'.



How can I solve this? What's missing? VS2013 point the error to the FakeClock type in "FakeClock fakeClock =..."


Aucun commentaire:

Enregistrer un commentaire