Exemplo n.º 1
0
        public void Get_With_Invalid_Id_Should_Return_Exception()
        {
            BillsController billsCtrl = new BillsController(_contextFixture.DbContext);
            Action          result    = () => billsCtrl.GetBill("32423-234324");

            result.Should().ThrowExactly <ArgumentException>();
        }
Exemplo n.º 2
0
        public void Get_With_Saved_Id_Should_Return_OkResult()
        {
            BillsController billsCtrl      = new BillsController(_contextFixture.DbContext);
            var             firstBill      = billsCtrl.GetBills().First();
            var             okObjectResult = billsCtrl.GetBill(firstBill.Id.ToString()) as OkObjectResult;

            okObjectResult.Should().BeOfType <OkObjectResult>();
        }
Exemplo n.º 3
0
        public void Get_With_Random_Id_Should_Return_NotFoundResult()
        {
            BillsController billsCtrl  = new BillsController(_contextFixture.DbContext);
            string          randomGuid = Guid.NewGuid().ToString();
            var             result     = billsCtrl.GetBill(randomGuid);

            result.Should().BeOfType <NotFoundResult>();
        }
Exemplo n.º 4
0
        public void Get_With_Given_Id_Should_Return_Bill()
        {
            BillsController billsCtrl      = new BillsController(_contextFixture.DbContext);
            var             firstBill      = billsCtrl.GetBills().First();
            var             okObjectResult = billsCtrl.GetBill(firstBill.Id.ToString()) as OkObjectResult;

            okObjectResult.Value.Should().NotBeNull();
        }