Files
cefsharp/CefSharp.Test/Framework/LegacyCamelCaseJavascriptNameConverterTests.cs
Alex Maitland cafd378859 Test - Code Cleanup
- Start splitting tests out into own files where relevant
- Improve call ordering
- Use Assert.RaisesAsync where possible
- Classes have been renamed (Tests is now the standard suffix)

TODO: Some of the classes still need their method names changed
2023-02-17 13:53:23 +10:00

39 lines
1.2 KiB
C#

// Copyright © 2020 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using CefSharp.JavascriptBinding;
using Xunit;
namespace CefSharp.Test.Framework
{
/// <summary>
/// LegacyCamelCaseJavascriptNameConverterFacts - Test the different name converters
/// </summary>
public class LegacyCamelCaseJavascriptNameConverterTests
{
[Fact]
public void CanConvertStringToJavascriptName()
{
IJavascriptNameConverter converter = new LegacyCamelCaseJavascriptNameConverter();
var propertyInfo = new TestMemberInfo("APropertyName");
var result = converter.ConvertToJavascript(propertyInfo);
Assert.Equal("aPropertyName", result);
}
[Fact]
public void CanConvertStringToReturnedObjectName()
{
IJavascriptNameConverter converter = new LegacyCamelCaseJavascriptNameConverter();
var propertyInfo = new TestMemberInfo("APropertyName");
var result = converter.ConvertReturnedObjectPropertyAndFieldToNameJavascript(propertyInfo);
Assert.Equal(propertyInfo.Name, result);
}
}
}