Ejemplo n.º 1
0
        public async Task GetShould404()
        {
            var m = new Mock <IPadRepo>();

            m.Setup(ir => ir.Get(It.IsAny <string>())).ReturnsAsync(default(Pad));

            var lpc = new LaunchpadsController(m.Object, logger);

            var response = await lpc.Get("garbage");

            Assert.IsType <NotFoundResult>(response.Result);
        }
Ejemplo n.º 2
0
        public async Task GetRunsGetAll()
        {
            var m = new Mock <IPadRepo>();

            m.Setup(ir => ir.GetAll()).ReturnsAsync(new Pad[] {
                new Pad
                {
                    Status = "yep",
                    Id     = "yep",
                    Name   = "Ed"
                }
            });

            var lpc = new LaunchpadsController(m.Object, logger);

            var response = await lpc.Get();

            Assert.Equal("yep", response.Value[0].Id);
        }