public async Task ListOneGroupInfoAsync_Test() { var mockExecuter = new Mock <IExecuter>(); var mockClusterFactory = new Mock <IClusterFactory>(); mockExecuter.Setup(x => x.Execute(It.IsAny <FastDFSReq <ListOneGroupResp> >(), It.IsAny <string>(), It.IsAny <ConnectionAddress>())).ReturnsAsync(new ListOneGroupResp() { GroupInfo = new GroupInfo() { GroupName = "group2" } }); IFastDFSClient client = new FastDFSClient(mockExecuter.Object, mockClusterFactory.Object); var groupInfo = await client.ListOneGroupInfoAsync("group1"); Assert.Equal("group2", groupInfo.GroupName); mockExecuter.Verify(x => x.Execute(It.IsAny <FastDFSReq <ListOneGroupResp> >(), It.IsAny <string>(), It.IsAny <ConnectionAddress>()), Times.Once); }