Exemple #1
0
        public void DoppioClass_Countructor_ShouldInitializeObjectCorrectly()
        {
            // Arrange
            var coffeeSize = CoffeSizeType.Medium;

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj, Is.InstanceOf <Doppio>());
        }
Exemple #2
0
        public void DoppioClass_FullDescriptionProperty_ShouldExists()
        {
            // Arrange
            var coffeeSize = CoffeSizeType.Medium;

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj, Has.Property("FullDescription"));
        }
Exemple #3
0
        public void DoppioClass_ShouldInheritCoffeeAbstractClass()
        {
            // Arrange
            var coffeeSize = CoffeSizeType.Medium;

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj, Is.InstanceOf <Coffee>());
        }
Exemple #4
0
        public void DoppioClass_ShouldImplementICoffeeInterface()
        {
            // Arrange
            var coffeeSize = CoffeSizeType.Medium;

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj, Is.InstanceOf <ICoffee>());
        }
Exemple #5
0
        public void DoppioClass_Countructor_ShouldSetSizeCorrectly()
        {
            // Arrange
            var coffeeSize   = CoffeSizeType.Medium;
            var expectedSize = coffeeSize.ToString();

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj.FullDescription, Does.Contain(expectedSize));
        }
Exemple #6
0
        public void DoppioClass_IdProperty_ShouldReturnCorrectId()
        {
            // Arrange
            var coffeeSize = CoffeSizeType.Medium;
            var expectedId = "DOP";

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj, Has.Property("Id").EqualTo(expectedId));
        }
Exemple #7
0
        public void DoppioClass_CostMethod_ShouldReturnCorrectPriceBasedOnCoffeSize(CoffeSizeType coffeeSize)
        {
            // Arrange
            var basePrice    = 2.50m;
            var expectedCost = basePrice + (((int)coffeeSize / 100) * basePrice);

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj.Cost(), Is.EqualTo(expectedCost));
        }
Exemple #8
0
        public void DoppioClass_FullDescriptionProperty_ShouldReturnCorrectFullDescription()
        {
            // Arrange
            var coffeeSize              = CoffeSizeType.Medium;
            var expectedDescription     = "Doppio";
            var expectedSize            = coffeeSize.ToString();
            var expectedFullDescription = expectedSize + " " + expectedDescription;

            // Act
            var obj = new Doppio(coffeeSize);

            // Assert
            Assert.That(obj, Has.Property("FullDescription").EqualTo(expectedFullDescription));
        }