Table of Contents

There are just two steps. First in your setup add the following:

TestContext.Services.AddLocalization();

Then in your test code, when you need the localized string to compare, you write the following:

var localizer = ctx.Services.GetService<IStringLocalizer<SharedStrings>>();

Where SharedStrings.cs (you can name this anything you want) that has the resource files such as `SharedStrings.en.resx`

Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.