Example #1
0
        public void TestShouldReturnFirst()
        {
            // arrange
            var repositoryData = new List <Launchpad>
            {
                new Launchpad
                {
                    Id     = 1,
                    Name   = "Launchpad 1",
                    Status = "active",
                }
            };

            var repository = new Mock <ILaunchpadRepository>();

            repository.Setup(x => x.Get(It.IsAny <int?>(), It.IsAny <int?>())).Returns(Task.FromResult <IList <Launchpad> >(repositoryData));
            var service = new LaunchpadService(repository.Object);

            // act
            var result = service.Get(1, null).Result;

            // assert
            Assert.AreEqual(result.Count, 1);
            Assert.AreEqual(result[0].Id, 1);
        }
Example #2
0
        public void Get_Returns_Launchpads()
        {
            var response = _launchpadService.Get("status", "name").Result;

            Assert.IsInstanceOf(typeof(IEnumerable <Launchpad>), response);
        }