Ejemplo n.º 1
0
        public void ValidateShouldProperlyValidatePrice()
        {
            var order = new FlatOrder("1", 1, "chleb", 1, null);

            Assert.Multiple(() =>
            {
                Assert.That(order.IsValid, Is.False);
                Assert.That(order.Validate().Count, Is.EqualTo(1));
            });
        }
Ejemplo n.º 2
0
        public void ValidateShouldProperlyValidateName(string name)
        {
            var order = new FlatOrder("1", 1, name, 1, 1);

            Assert.Multiple(() =>
            {
                Assert.That(order.IsValid, Is.False);
                Assert.That(order.Validate().Count, Is.EqualTo(1));
            });
        }
Ejemplo n.º 3
0
        public void ValidateShouldProperlyValiedNameAgainstItsLength()
        {
            var order = new FlatOrder("1", 1, new string('a', 256), 1, 1);

            Assert.Multiple(() =>
            {
                Assert.That(order.IsValid, Is.False);
                Assert.That(order.Validate().Count, Is.EqualTo(1));
            });
        }
Ejemplo n.º 4
0
        public void ValidateShouldProperlyValidateClientId(string clientId)
        {
            var order = new FlatOrder(clientId, 1, "chleb", 1, 1);

            Assert.Multiple(() =>
            {
                Assert.That(order.IsValid, Is.False);
                Assert.That(order.Validate().Count, Is.EqualTo(1));
            });
        }