public void OneTimeSetUp()
        {
            _backend         = Substitute.For <ITranslationBackend>();
            _pluralResolver  = Substitute.For <IPluralResolver>();
            _interpolator    = Substitute.For <IInterpolator>();
            _translationTree = Substitute.For <ITranslationTree>();

            _pluralResolver.GetPluralSuffix("en-US", 0).Returns("_0");
            _pluralResolver.GetPluralSuffix("en-US", 1).Returns("_1");
            _pluralResolver.GetPluralSuffix("en-US", 2).Returns("_2");
            _pluralResolver.GetPluralSuffix("en-US", 3).Returns("_3");
            _pluralResolver.GetPluralSuffix("en-US", 4).Returns("_4");
            _pluralResolver.GetPluralSuffix("en-US", 5).Returns("_5");
            _pluralResolver.NeedsPlural("en-US").Returns(true);
            _backend.LoadNamespaceAsync("en-US", "test").Returns(_translationTree);
            _interpolator.InterpolateAsync(null, null, null, null).ReturnsForAnyArgs(c => c.ArgAt <string>(0));
            _interpolator.NestAsync(null, null, null, null).ReturnsForAnyArgs(c => c.ArgAt <string>(0));
        }
示例#2
0
 public async Task OneTimeSetUp()
 {
     _backend = new StrictXmlFileBackend("TestFiles");
     _tree    = await _backend.LoadNamespaceAsync("en-US", "test-strict");
 }