public async Task <ActionResult <Library.Destination> > NewDest(Library.Destination input)
        {
            var dest = await data.NewDestination(input);

            if (dest == null)
            {
                return(BadRequest());
            }
            return(Ok(dest));
        }
Exemplo n.º 2
0
        public void TestGetDestinationById()
        {
            Library.Destination destination = new Library.Destination("Taco Bell", 4, "");
            int id       = 4;
            var mockRepo = new Mock <IDataRepository>();

            mockRepo.Setup(x => x.GetDestinationById(id)).ReturnsAsync(destination);
            var actual = mockRepo.Object;

            Assert.NotNull(actual);
        }
Exemplo n.º 3
0
        public void TestGetDrive()
        {
            Library.Driver driver = new Library.Driver()
            {
                Name    = "wknain",
                Pass    = "******",
                Company = "Revature",
                Seats   = 4,
                MeetLoc = "Garage"
            };
            Library.Destination destination = new Library.Destination("Taco Bell", 1, "");
            PickupDrive         drive       = new PickupDrive(driver, destination, DateTime.Now);
            int id       = 1;
            var mockRepo = new Mock <IDataRepository>();

            mockRepo.Setup(x => x.GetDrive(id)).ReturnsAsync(drive);

            var actual = mockRepo.Object;

            Assert.NotNull(actual);
        }