public void CanExpandUrl() { var dbUserUrl = new Shorty.Data.UserUrl() { Id = 1000, OriginalUrl = "http://google.com", AccessCount = 0, }; var testUrl = "http://bitly.com/Ge"; var repo = new Mock<IRepository>(); repo.Setup(r => r.GetById(It.IsAny<int>())).Returns(() => dbUserUrl); var converter = new BaseConverter(); shortener = new ShortService(converter, repo.Object); var result = shortener.ExpandUrl(testUrl); }