This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new Enum values for ControllerType. Created associated unit tests.
- Loading branch information
Showing
3 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...s/BrightcoveOS .NET-MAPI-Wrapper.Tests/IntegrationTests/VideoWrite/VideoWriteCoreTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System.Collections.Generic; | ||
using System.Web.UI; | ||
using BrightcoveMapiWrapper.Model; | ||
using BrightcoveMapiWrapper.Model.Containers; | ||
using BrightcoveMapiWrapper.Model.Items; | ||
using BrightcoveMapiWrapper.Serialization; | ||
using System.Web.Script.Serialization; | ||
using BrightcoveMapiWrapper.Util.Extensions; | ||
using NUnit.Framework; | ||
|
||
namespace BrightcoveOS.NET_MAPI_Wrapper.Tests.IntegrationTests.VideoWrite | ||
{ | ||
[TestFixture] | ||
public class VideoWriteCoreTests : VideoWriteTestBase | ||
{ | ||
[Test] | ||
public void Deserialize_Video_Test_Basic() | ||
{ | ||
JavaScriptSerializer serializer = BrightcoveSerializerFactory.GetSerializer(); | ||
IDictionary<string, object> dictionary = new Dictionary<string, object>(); | ||
var testrenditionCollection = new BrightcoveItemCollection<BrightcoveRendition>(); | ||
var testrendition = new BrightcoveRendition(); | ||
testrendition.ControllerType = ControllerType.AkamaiHd; | ||
testrenditionCollection.Add(testrendition); | ||
dictionary.Add("renditions", testrenditionCollection); | ||
|
||
var renditions = | ||
serializer.ConvertToType<BrightcoveItemCollection<BrightcoveRendition>>(dictionary["renditions"]); | ||
Assert.That(renditions[0].ControllerType, Is.EqualTo(ControllerType.AkamaiHd)); | ||
} | ||
|
||
[Test] | ||
public void EnumExtension_ToBrightcoveName_Test() | ||
{ | ||
var testrendition = new BrightcoveRendition(); | ||
testrendition.ControllerType = ControllerType.AkamaiHd; | ||
var brightcoveName = testrendition.ControllerType.ToBrightcoveName(); | ||
Assert.That(brightcoveName, Is.EqualTo("AKAMAI_HD")); | ||
} | ||
|
||
[Test] | ||
public void EnumExtension_ToBrightcoveEnum_Test() | ||
{ | ||
const string brightcoveName = "AKAMAI_HD2"; | ||
var testrendition = new BrightcoveRendition(); | ||
testrendition.ControllerType = (brightcoveName).ToBrightcoveEnum<ControllerType>(); | ||
Assert.That(testrendition.ControllerType, Is.EqualTo(ControllerType.AkamaiHd2)); | ||
} | ||
|
||
[Test] | ||
public void EnumExtension_ToBrightcoveEnum_Test_InvalidValue() | ||
{ | ||
const string brightcoveName = "BAD-CONTROLLERTYPE-NAME"; | ||
var testrendition = new BrightcoveRendition(); | ||
testrendition.ControllerType = (brightcoveName).ToBrightcoveEnum<ControllerType>(); | ||
Assert.That(testrendition.ControllerType, Is.EqualTo(ControllerType.None)); | ||
} | ||
} | ||
} |