public void SaveTest() { // Arrange var type = "HomeController"; var key = $"{type}.{CultureInfo.CurrentUICulture.Name}"; var hostingEnvironmentTest = TestHostingEnvironment(); var fileSystem = TestFileSytem(); var cache = new JsonLocalizationCache(hostingEnvironmentTest, fileSystem.Object); //act var dict = new TranslationDictionary(); dict["specific"] = new Translation() { str = "Culture specific", Added = new DateTime(1) }; cache.Save(new KeyValuePair<string, TranslationDictionary>(key, dict)); //assert fileSystem.Verify(m => m.WriteAllText(It.IsAny<string>(), It.IsAny<string>()), Times.Once()); }