Beispiel #1
0
        public async Task VstsWorkItemClientCallsGetStringAsync()
        {
            var vsts = new Mock <IVstsHttpClient>();

            var workItemMapper     = new Mock <IVstsMapper <WorkItem> >();
            var vstsWorkItemClient = new VstsWorkItemClient(vsts.Object, workItemMapper.Object);

            var workItem = await vstsWorkItemClient.GetWorkItemAsync(0);

            vsts.Verify(_ => _.GetStringAsync(It.IsAny <string>()));
        }
Beispiel #2
0
        public async Task VstsWorkItemClientClasWorkItemMapper()
        {
            var vsts           = new Mock <IVstsHttpClient>();
            var workItemMapper = new Mock <IVstsMapper <WorkItem> >();

            workItemMapper.Setup(_ => _.Map(It.IsAny <string>())).Returns(new WorkItem());
            var vstsWorkItemClient = new VstsWorkItemClient(vsts.Object, workItemMapper.Object);

            var workItem = await vstsWorkItemClient.GetWorkItemAsync(0);

            Assert.NotNull(workItem);
        }