public void TestEnumAsJavascriptObject_WithValues() { // Arrange // Act MvcHtmlString testEnumString = HtmlHelpers.EnumAsJavascriptObject <TestEnumWithValues>(null); // Assert Assert.AreEqual("var testEnumWithValuesEnum = Object.freeze({ V1: 10, Value2: 22, AnotherValue: 333 });", testEnumString.ToString()); }
public void TestEnumAsJavascriptObject_ThrowsException() { // Arrange // Act MvcHtmlString testEnumString = HtmlHelpers.EnumAsJavascriptObject <TestBase>(null); // Assert Assert.Fail($"Error result: {testEnumString}"); }
public void TestEnumAsJavascriptObject() { // Arrange // Act MvcHtmlString testEnumString = HtmlHelpers.EnumAsJavascriptObject <TestEnum>(null); // Assert Assert.AreEqual("var testEnumEnum = Object.freeze({ None: 0, SomeValue: 1 });", testEnumString.ToString()); }