Exemplo n.º 1
0
        public async Task ITheme_ApiVersion(ThemeResponse expected)
        {
            using var handler = MockHttpMessageHandler.SetupHandler(expected);
            var api    = handler.SetupApi <ITheme>();
            var result = await api.GetAsync(CancellationToken.None);

            result.Should().BeEquivalentTo(expected);
            handler.ConfirmPath($"/services/data/{Api.Version}/theme");
        }
Exemplo n.º 2
0
        public static EditThemeRequest ToEditThemeRequest(this ThemeResponse themeResponse)
        {
            EditThemeRequest editThemeRequest = new EditThemeRequest()
            {
                Id        = themeResponse.Id,
                SubjectId = themeResponse.SubjectId,
                Title     = themeResponse.Title,
                TimeLine  = themeResponse.TimeLine
            };

            return(editThemeRequest);
        }
Exemplo n.º 3
0
        public static ThemeResponse ToThemeResponse(this Theme theme)
        {
            ThemeResponse themeResponse = new ThemeResponse()
            {
                Id             = theme.Id,
                Title          = theme.Title,
                SubjectId      = theme.SubjectId,
                SubjectTitle   = theme.Subject.Title,
                TimeLine       = theme.TimeLine,
                QuestionsCount = theme.QuestionThemes.Count
            };

            return(themeResponse);
        }
        public void getSlidesThemeTest()
        {
            ThemeResponse response = null;

            try
            {
                GetSlidesThemeRequest request = createGetSlidesThemeRequest();
                response = api.GetSlidesTheme(request);
                Console.WriteLine(response.Code);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 5
0
        public void GetSlidesThemeInvalidName()
        {
            InvalidPropertyTestExecutor <GetSlidesThemeRequest, ThemeResponse> testExecutor =
                new InvalidPropertyTestExecutor <GetSlidesThemeRequest, ThemeResponse>("GetSlidesTheme", "Name");
            GetSlidesThemeRequest request  = testExecutor.PrepareRequest();
            ThemeResponse         response = null;
            bool needAssertResponse        = false;

            try
            {
                response           = m_instance.GetSlidesTheme(request);
                needAssertResponse = true;
            }
            catch (Exception ex)
            {
                testExecutor.AssertException(ex);
            }
            if (needAssertResponse)
            {
                testExecutor.AssertResult(response);
            }
        }