using BasicSample.Core.Domain; using NUnit.Framework; namespace BasicSample.Tests.Domain { [TestFixture] public class OrderTests { [Test] public void CanCreateOrder() { Customer customer = new Customer("ACME"); Order order = new Order(customer); Assert.IsTrue(customer.Equals(order.OrderedBy)); } [Test] public void CanCompareOrders() { Order orderA = new Order(new Customer("Acme")); Order orderB = new Order(new Customer("Anvil")); Assert.AreNotEqual(orderA, null); Assert.AreNotEqual(orderA, orderB); DomainObjectIdSetter<long> idSetter = new DomainObjectIdSetter<long>(); idSetter.SetIdOf(orderA, 1); Order orderC = new Order(new Customer("Acme")); Assert.AreEqual(orderA, orderC); idSetter.SetIdOf(orderC, 2); Assert.AreNotEqual(orderA, orderC); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)