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); } }
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); } }
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()); } }