コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public void GetOtherProductsFromRepo_ShouldReturnDivideByZeroException()
        {
            IOtherProductRepo test = new OtherProductRepo();

            test.GetOtherProductsFromRepo(_errorValue);
        }