Example #1
0
        public async Task Get_Product_By_ID_Should_Return_Particular_Product()
        {
            MongoProductStore productStore = new MongoProductStore();
            var product = await productStore.GetProductAsync(demoProductEntity.Id);

            Assert.Equal(product.Product.Id, demoProductEntity.Id);
        }
Example #2
0
        public async Task Get_Product_By_ID_Should_Return_Exception_If_Id_IS_Invalid()
        {
            MongoProductStore productStore = new MongoProductStore();
            Exception         ex           = await Assert.ThrowsAsync <BaseException>(() => productStore.GetProductAsync(demoProductEntity.Id + "INVALID_ID"));

            Assert.Equal("Requested Id is not found.", ex.Message);
        }