482a46b568
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.
35 lines
843 B
C#
35 lines
843 B
C#
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]);
|
|
}
|
|
|
|
|
|
}
|
|
}
|