コード例 #1
0
        public void ShouldThrowExceptionIfConfigurationIsNull()
        {
            // Given
            IQueryTeachersData queryTeachers = null;

            // When
            Action createQuery = () => queryTeachers = TeacherQueryFactory.CreateQuery(null);

            // Then
            createQuery.Should().Throw <ArgumentNullException>();

            queryTeachers.Should().BeNull();
        }
コード例 #2
0
        public void ShouldCreateQueryIfConfigurationWasSupplied()
        {
            // Given
            Dictionary <EndpointType, string> endpoints = new Dictionary <EndpointType, string>
            {
                { EndpointType.TeacherList, "teacher_list" },
                { EndpointType.Teacher, "teacher" }
            };
            IQueryTeachersData queryTeachers = null;

            // When
            Action createQuery = () =>
                                 queryTeachers =
                TeacherQueryFactory.CreateQuery(new ClientConfiguration("http://example.com", endpoints));

            // Then
            createQuery.Should().NotThrow();
            queryTeachers.Should().NotBeNull();
        }