BlogSharp.Core.Impl.Tests.Services.Template.TemplateSourceTests.Can_register_with_file C# (CSharp) Method

Can_register_with_file() private method

private Can_register_with_file ( ) : void
return void
        public void Can_register_with_file()
        {
            string file = "#templateengine(spark)\nyet another team";
            Stream fileStream = new MemoryStream();
            StreamWriter sw = new StreamWriter(fileStream);
            sw.Write(file);
            sw.Flush();
            fileStream.Position = 0;

            string fileName = "blah";
            fileService.Expect(x => x.OpenFileForRead(fileName)).Return(fileStream);

            templateSource.RegisterTemplateWithFile("mail", "blah");
            ITemplate template = templateSource.GetTemplateWithKey("mail");
            templateEngineRegistry.AssertWasCalled(x => x.GetTemplateEngine("spark"));
            Assert.That(template.GetContent(), Is.EqualTo("yet another team"));
        }