public void GetDirectories_WithRightData_Test_listOfdirectory() { var mockDirectoryService = new Mock <IDirectoryService>(); this.controller.DirectoryService = mockDirectoryService.Object; string[] result = { "directory1", "directory2" }; mockDirectoryService.Setup(services => services.GetDirectoriesList("test")).Returns(result); var json = controller.GetDirectoriesList("test"); Assert.AreEqual(json.Data, result); }