コード例 #1
0
        public void WhenGenerateEmbedIframeTag_ThenCheckCode()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, GenerateEmbledHandler))
            {
                var client  = new YouScribeClient(TestHelpers.BaseUrl);
                var request = client.CreateEmbedRequest();

                int productId = 1;

                // Act
                var tag = request.GenerateIframeTagAsync(productId).Result;

                // Assert
                Assert.NotEmpty(tag);
                Assert.Equal("embed1", tag);
            }
        }
コード例 #2
0
        public void WhenGenerateEmbedIframeTag_ThenCheckCode()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, GenerateEmbledHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);
                var request = client.CreateEmbedRequest();

                int productId = 1;

                // Act
                var tag = request.GenerateIframeTagAsync(productId).Result;

                // Assert
                Assert.NotEmpty(tag);
                Assert.Equal("embed1", tag);
            }
        }
コード例 #3
0
        public void WhenGenerateEmbedIframeTagWithFeatures_ThenCheckCode()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, GenerateEmbledHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);
                var request = client.CreateEmbedRequest();

                int productId = 1;

                // Act
                var tag = request.GenerateIframeTagAsync(productId, new Models.Products.EmbedGenerateModel { Width = 600, Height = 300 }).Result;

                // Assert
                Assert.NotEmpty(tag);
                Assert.Equal("embed2", tag);
            }
        }
コード例 #4
0
        public void WhenGenerateEmbedIframeTagWithFeatures_ThenCheckCode()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, GenerateEmbledHandler))
            {
                var client  = new YouScribeClient(TestHelpers.BaseUrl);
                var request = client.CreateEmbedRequest();

                int productId = 1;

                // Act
                var tag = request.GenerateIframeTagAsync(productId, new Models.Products.EmbedGenerateModel {
                    Width = 600, Height = 300
                }).Result;

                // Assert
                Assert.NotEmpty(tag);
                Assert.Equal("embed2", tag);
            }
        }
コード例 #5
0
        public void WhenGeneratePrivateEmbedIframeTagWithUnauthorizedUser_ThenCheckCode()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, GenerateEmbledHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                var request = client.CreateEmbedRequest();

                int productId = 1;

                // Act
                var tag = request.GeneratePrivateIframeTagAsync(productId).Result;

                // Assert
                Assert.Empty(tag);
                Assert.NotEmpty(request.Error.Messages);
                Assert.Contains("Not connected", request.Error.Messages.First());
            }
        }
コード例 #6
0
        public void WhenGeneratePrivateEmbedIframeTagWithUnauthorizedUser_ThenCheckCode()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, GenerateEmbledHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                var request = client.CreateEmbedRequest();

                int productId = 1;

                // Act
                var tag = request.GeneratePrivateIframeTagAsync(productId).Result;

                // Assert
                Assert.Empty(tag);
                Assert.NotEmpty(request.Error.Messages);
                Assert.Contains("Not connected", request.Error.Messages.First());
            }
        }