Enhance project metadata and refactor core classes
Updated project files for `Beam.Dynamic`, `Beam.Exports`, `Beam.Temporary.Cli`, and `Beam` to include additional metadata and specific package versions. Refactored `DataBindings` and `ResolvedBindings` to records, added a new `Text` property in `Binding.cs`, and introduced `ParseNumbers` in `OnlineCleaner`. New classes `PuppetContext` and `PuppetUnitDownloader` added for Playwright integration. Introduced `ImmutableState` struct and `UnitDownloaderBinary` class for improved download management. Updated tests in `UnitTest1.cs` for number localization. Added `Beam.Puppeteer` project to the solution.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Beam.Dynamic;
|
||||
using Microsoft.Recognizers.Text;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Beam.Tests {
|
||||
public class OnlineCleanerTests {
|
||||
[Fact]
|
||||
public void Should_LocalizeArabic() {
|
||||
const string test = "1234";
|
||||
|
||||
List<int> localized = OnlineCleaner.ParseNumbers(test, Culture.English);
|
||||
|
||||
Assert.Single(localized);
|
||||
Assert.Equal(1234, localized[0]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Should_LocalizeIndian() {
|
||||
const string test = "九一五";
|
||||
|
||||
List<int> localized = OnlineCleaner.ParseNumbers(test, Culture.Chinese);
|
||||
|
||||
Assert.Single(localized);
|
||||
Assert.Equal(915, localized[0]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
namespace Beam.Tests {
|
||||
using System.Globalization;
|
||||
|
||||
namespace Beam.Tests {
|
||||
public class UnitTest1 {
|
||||
[Fact]
|
||||
public void Test1() {
|
||||
const string test = "九一五";
|
||||
|
||||
Assert.True(int.TryParse(test, CultureInfo.GetCultureInfo("zh-Hans").NumberFormat, out var number));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user