forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
25 lines
702 B
C#
25 lines
702 B
C#
using MagicCarpetContracts.Resources;
|
|
using Microsoft.Extensions.Localization;
|
|
using Moq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MagicCarpetTests.Infrastructure;
|
|
|
|
internal class StringLocalizerMockCreator
|
|
{
|
|
private static Mock<IStringLocalizer<Messages>>? _mockObject = null;
|
|
public static IStringLocalizer<Messages> GetObject()
|
|
{
|
|
if (_mockObject is null)
|
|
{
|
|
_mockObject = new Mock<IStringLocalizer<Messages>>();
|
|
_mockObject.Setup(_ => _[It.IsAny<string>()]).Returns(new LocalizedString("name", "value"));
|
|
}
|
|
return _mockObject!.Object;
|
|
}
|
|
}
|