public void Serialisation_ShouldWriteAllValues()
        {
            var serialiser = new MementoSerialiser();
            var order = new Order(12, _orderId, "Neil", false);
            order.AddItem(
                new OrderItem
                {
                    Cost = 2.99,
                    Name = "Beans on Toast",
                    IngredientsUsed = new string[0],
                    Quantity = 1
                });

            var json = serialiser.Serialise<Order, OrderMemento>(order);

            Assert.That(json, Is.EqualTo(GetJson()));
        }
Пример #2
0
        public void Serialisation_ShouldWriteAllValues()
        {
            var serialiser = new MementoSerialiser();
            var order      = new Order(12, _orderId, "Neil", false);

            order.AddItem(
                new OrderItem
            {
                Cost            = 2.99,
                Name            = "Beans on Toast",
                IngredientsUsed = new string[0],
                Quantity        = 1
            });

            string json = serialiser.Serialise <Order, OrderMemento>(order);

            Assert.That(json, Is.EqualTo(GetJson()));
        }