public void GetOtherProductsFromRepo_ShouldReturnDivideByZeroException() { string message = "Attempted to divide by zero."; IOtherProductRepo test = new OtherProductRepo(); var ex = Assert.Throws <DivideByZeroException>(() => test.GetOtherProductsFromRepo(_errorValue)); Assert.Equal(message, ex.Message); }
public void GetOtherProductsFromRepo_ShouldReturnAllProducts() { // arrange OtherProductRepo service = new OtherProductRepo(); // act IList <Product> test = service.GetOtherProductsFromRepo(_firstValue); string result = test.First(x => x.Name == _firstValue.Name).Price; string expected = _dataSource.First(x => x.Name == _firstValue.Name).Price; // assert Assert.Equal(result, expected); }
public void GetOtherProductsFromRepo_ShouldReturnDivideByZeroException() { IOtherProductRepo test = new OtherProductRepo(); test.GetOtherProductsFromRepo(_errorValue); }