Ejemplo n.º 1
0
        public void InvalidBandDColorTest()
        {
            // Arrange
            // This is where I would mock any dependencies like ILogger<> or any others...
            var calculator = new CalculateOhmValuesImpl();


            // Act & Assert
            Assert.Throws <ArgumentOutOfRangeException>(() => calculator.CalculateOhmValue("brown", "orange", "red", "purple"));
        }
Ejemplo n.º 2
0
        public void NullBandDTest()
        {
            // Arrange
            // This is where I would mock any dependencies like ILogger<> or any others...
            var calculator = new CalculateOhmValuesImpl();


            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => calculator.CalculateOhmValue("blue", "orange", "red", null));
        }
Ejemplo n.º 3
0
        public void BandTest()
        {
            // Arrange
            // This is where I would mock any dependencies like ILogger<> or any others...
            var calculator = new CalculateOhmValuesImpl();


            // Act
            int result = calculator.CalculateOhmValue("blue", "gray", "red", "gold");

            Assert.NotNull(calculator.Bands);
            Assert.True(calculator.Bands.Count() > 0);
        }
Ejemplo n.º 4
0
        public void ResitorValue10kTest()
        {
            // Arrange
            // This is where I would mock any dependencies like ILogger<>, HttpClient, or any others...
            var calculator = new CalculateOhmValuesImpl();


            // Act
            int result = calculator.CalculateOhmValue("brown", "black", "orange", "gold");


            // Assert
            Assert.Equal(10000, result);
        }