public Load ( string fileName ) : ITemplate | ||
fileName | string | Template file name |
Результат | ITemplate |
public void Load_NullFileName_ArgumentNullExceptionThrown() { // Assign var tf = new TemplateFactory(_environment.Object, _languageManagerProvider.Object, "en"); // Act tf.Setup(); // Act & Assert Assert.Throws<ArgumentNullException>(() => tf.Load(null)); }
public void Load_NameWithoutTpl_TemplateLoadedCorrectly() { // Assign var tf = new TemplateFactory(_environment.Object, _languageManagerProvider.Object, "en"); // Act tf.Setup(); var data = tf.Load("Foo"); // Assert Assert.AreEqual("Dummy data", data.Get()); }
public void Load_WithCache_TemplateLoadedCorrectly() { // Assign var tf = new TemplateFactory(_environment.Object, _languageManagerProvider.Object, "en", true); // Act tf.Setup(); var data = tf.Load("Foo.tpl"); // Asset Assert.AreEqual("Dummy data", data.Get()); // Assign tf = new TemplateFactory(_environment.Object, _languageManagerProvider.Object, "en", true); tf.Setup(); Template.FileSystem = new Mock<IFileSystem>().Object; // Act data = tf.Load("Foo.tpl"); // Assert Assert.AreEqual("Dummy data", data.Get()); }
public void Load_FromManifestEnabled_CalledCorrectlyPathFixedWithDots() { // Assign var tf = new TemplateFactory(_environment.Object, _languageManagerProvider.Object, "en", true, true); // Act tf.Setup(); var result = tf.Load("Templates/Test.tpl"); // Assert Assert.AreEqual("Hello!", result.Get()); }