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")); }
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)); }
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); }
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); }