public void ValueTypePropertyNotEqual()
        {
            Order order = new Order();
            order.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            order.Quantity = 4;

            Order expectedOrder = new Order();
            expectedOrder.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            expectedOrder.Quantity = 10;

            AbstractConstraint sut = Property.AllPropertiesMatch(expectedOrder);

            Assert.False(sut.Eval(order));
            Assert.Equal("Expected value of Order.Quantity is '10', actual value is '4'", sut.Message);
        }
        public void SuccessTest()
        {
            Order order = new Order();
            order.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            order.Quantity = 4;

            Order expectedOrder = new Order();
            expectedOrder.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            expectedOrder.Quantity = 4;

            AbstractConstraint sut = Property.AllPropertiesMatch(expectedOrder);

            Assert.True(sut.Eval(order));
        }
        public void ReferenceTypePropertyNullTest()
        {
            Order order = new Order();
            order.Product = null;
            order.Quantity = 4;

            Order expectedOrder = new Order();
            expectedOrder.Product = null;
            expectedOrder.Quantity = 4;

            AbstractConstraint sut = Property.AllPropertiesMatch(expectedOrder);

            Assert.True(sut.Eval(order));
        }
        public void NullableTypeSetTest()
        {
            Order order = new Order();
            order.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            order.Quantity = 4;
            order.Product.Weight = 18;

            Order expectedOrder = new Order();
            expectedOrder.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            expectedOrder.Quantity = 4;

            AbstractConstraint sut = Property.AllPropertiesMatch(expectedOrder);

            Assert.False(sut.Eval(order));
            Assert.Equal("Expected value of Order.Product.Weight is null, actual value is '18'", sut.Message);
        }
        public void ExpectedReferenceTypePropertyNullTest()
        {
            Order order = new Order();
            order.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            order.Quantity = 4;

            Order expectedOrder = new Order();
            expectedOrder.Product = null;
            expectedOrder.Quantity = 4;

            AbstractConstraint sut = Property.AllPropertiesMatch(expectedOrder);

            Assert.False(sut.Eval(order));
            Assert.Equal("Expected value of Order.Product is null, actual value is 'Rhino.Mocks.Tests.AllPropertiesMatchConstraint.Product'", sut.Message);
        }
        public void ExpectedDifferentTypeThanActual()
        {
            Order order = new Order();
            order.Product = new Product("Ratched and Clank - Tools of Destruction", 61.05);
            order.Quantity = 4;
            order.Product.Weight = 18;

            Product expectedProduct = new Product("Ratched and Clank - Tools of Destruction", 61.05);

            AbstractConstraint sut = Property.AllPropertiesMatch(expectedProduct);

            Assert.False(sut.Eval(order));
            Assert.Equal("Expected type 'Product' doesn't match with actual type 'Order'", sut.Message);
        }