public void AddBuildTagTest() { var guid = Guid.NewGuid(); var service = new BuildService(_mockClientFactory.Object, guid); var token = new CancellationToken(); var returnArray = new List <string>() { "value" }; _mockBuildClient.Setup(x => x.AddBuildTagAsync( It.Is <Guid>(a => a == guid), It.Is <int>(b => b == 1234), It.Is <string>(c => c == "tag"), It.IsAny <object>(), It.Is <CancellationToken>(d => d == token))) .Returns(Task.FromResult(returnArray)); var array = service.AddBuildTag(1234, "tag", token).Result; Assert.AreEqual(array, returnArray); }