Skip to content

Commit

Permalink
Added new Enum values for ControllerType. Created associated unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedesantis authored and dmillz committed Nov 21, 2014
1 parent 02654fc commit 322b6d4
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,32 @@ public enum ControllerType
/// <summary>
/// Uses the default controller.
/// </summary>
Default
Default,
/// <summary>
/// Uses the Akamai HD controller.
/// </summary>
AkamaiHd,
/// <summary>
/// Uses the Akamai HD Live controller.
/// </summary>
AkamaiHdLive,
/// <summary>
/// Uses the Akamai Streaming controller.
/// </summary>
AkamaiHd2,
/// <summary>
/// Uses the Akamai Secure Streaming controller.
/// </summary>
AkamaiSecureStreaming,
/// <summary>
/// Uses the Akamai Streaming controller.
/// </summary>
AkamaiStreaming,
/// <summary>
/// Uses the Limelight Media vault(?) controller.
/// </summary>
LimelightMediavalut

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
Expand Down Expand Up @@ -116,6 +117,7 @@
<Compile Include="IntegrationTests\VideoWrite\RemoveLogoOverlayTests.cs" />
<Compile Include="IntegrationTests\VideoWrite\ShareVideoTests.cs" />
<Compile Include="IntegrationTests\VideoWrite\UnshareVideoTests.cs" />
<Compile Include="IntegrationTests\VideoWrite\VideoWriteCoreTests.cs" />
<Compile Include="IntegrationTests\VideoWrite\UpdateVideoTests.cs" />
<Compile Include="IntegrationTests\VideoWrite\VideoWriteTestBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
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));
}
}
}

0 comments on commit 322b6d4

Please sign in to comment.