public void GetImageId_Positive() { int roomId = 10; Image image = new Image() { ImageId = 10, RoomId = 12, RoomImage = new byte[1] { Convert.ToByte(12) } }; //var imageList = new List<Image>(); //imageList.Add(image); var MockRoomBusiness = new Mock <RoomManager>(); MockRoomBusiness.Setup(p => p.GetImagesId(roomId)).Returns(image.RoomImage); RoomsController roomsController = new RoomsController(MockRoomBusiness.Object); var actualReturnType = roomsController.GetImageById(roomId); Assert.ReferenceEquals(image.RoomImage, actualReturnType.GetHashCode()); }