public async Task ScenarioFromBoardExtension_SearchWorkItemById()
        {
            // Arrange
            var fakeResponse = new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK,
                Content    = new StringContent(JsonConvert.SerializeObject(this._fileContent), Encoding.UTF8, "application/json")
            };
            var fakeCakeContext = new FakeCakeContext(logBehaviour: () => new FakeCakeLog());
            var fakeClient      = new HttpClient(new FakeHttpMessageHandler(fakeResponse))
            {
                BaseAddress = new Uri($"https://dev.azure.com/{this._organization}")
            };
            var board = new AzureBoards(fakeClient);

            // Act
            IWorkItem wit = await board.GetWorkItemByIdAsync(this._witId);

            // Assert
            Assert.IsType <WorkItem>(wit);

            Assert.Equal(this._witId, wit.Id);
            Assert.Equal(this._witState, wit.State);
            Assert.Equal(this._witTitle, wit.Title);
            Assert.Equal(this._witType, wit.Type);
            Assert.Equal(this._witDescription, wit.Description);
            Assert.Equal(this._witUrl, ((WorkItem)wit).Url);
        }
        public async Task ScenarioFromCakeContextExtensionWithPatAndOrganization_SearchWorkItemById()
        {
            // Arrange
            var fakeResponse = new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK,
                Content    = new StringContent(JsonConvert.SerializeObject(this._fileContent), Encoding.UTF8, "application/json")
            };
            var fakeCakeContext = new FakeCakeContext(logBehaviour: () => new FakeCakeLog());
            var fakeClient      = new HttpClient(new FakeHttpMessageHandler(fakeResponse))
            {
                BaseAddress = new Uri($"https://dev.azure.com/{this._organization}")
            };
            var board = new AzureBoards(fakeClient);

            FieldInfo commandBehaviour = typeof(WorkItemCommand).GetRuntimeFields().Single(p => p.Name == "_getWorkItemByIdBehaviourAsync");
            object    originBehaviour  = commandBehaviour.GetValue(typeof(WorkItemCommand));

            // Act
            commandBehaviour.SetValue(typeof(WorkItemCommand), (Func <IBoard, string, Task <IWorkItem> >)((azureBoard, id) => board.GetWorkItemByIdAsync(id)));
            IWorkItem wit = await fakeCakeContext.GetWorkItemByIdAsync(this._pat, this._organization, this._witId);

            commandBehaviour.SetValue(typeof(WorkItemCommand), originBehaviour);

            // Assert
            Assert.IsType <WorkItem>(wit);

            Assert.Equal(this._witId, wit.Id);
            Assert.Equal(this._witState, wit.State);
            Assert.Equal(this._witTitle, wit.Title);
            Assert.Equal(this._witType, wit.Type);
            Assert.Equal(this._witDescription, wit.Description);
            Assert.Equal(this._witUrl, ((WorkItem)wit).Url);
        }