private void TestDeputyTranscriptsResult(IDeputyTranscriptsResult result) { Assertion.NotNull(result); Assert.Equal("Жириновский Владимир Вольфович", result.Name); Assert.Equal((int)PageSize.Five, result.PageSize); Assert.Equal(2, result.Page); Assert.True(result.Count > 0); var meetings = result.Meetings; Assert.True(meetings.Any()); var meeting = meetings.Single(x => x.Number == 164); Assert.Equal(new DateTime(2014, 4, 22), meeting.Date); Assert.Equal(164, meeting.Number); Assert.Equal(7350, meeting.LinesCount); var question = meeting.Questions.Single(); Assert.Equal("Об отчёте Правительства Российской Федерации о результатах его деятельности за 2013 год.", question.Name); Assert.Null(question.Stage); Assert.Equal(3, question.Parts.Count()); var part = question.Parts.First(); Assert.Equal(4099, part.StartLine); Assert.Equal(4262, part.EndLine); Assert.True(part.Text().Contains("ЖИРИНОВСКИЙ В. В., руководитель фракции ЛДПР.")); Assert.False(part.Votes.Any()); }
/// <summary> /// <para>Returns transcription of deputy's speeches.</para> /// </summary> /// <param name="caller">API caller instance to be used.</param> /// <param name="call">Delegate to configure additional parameters of request.</param> /// <param name="result">Deputy's transcripts result.</param> /// <returns><c>true</c> if call was successful and <paramref name="result"/> output parameter contains result of deputy's transcripts search, or <c>false</c> if call failed and <paramref name="result"/> output parameter is a <c>null</c> reference.</returns> /// <exception cref="ArgumentNullException">If either <paramref name="caller"/> or <paramref name="call"/> is a <c>null</c> reference.</exception> /// <seealso cref="http://api.duma.gov.ru/pages/dokumentatsiya/stenogrammi-vistupleniy-deputata"/> public static bool Deputy(this ITranscriptsApiCaller caller, Action<IDeputyTranscriptLawApiCall> call, out IDeputyTranscriptsResult result) { Assertion.NotNull(caller); Assertion.NotNull(call); try { result = caller.Deputy(call); return true; } catch { result = null; return false; } }