Esempio n. 1
0
 public void FindModuleContainingPathOfModuleReturnsTheModule()
 {
     var expectedModule = new Module("~/test");
     var container = new ModuleContainer<Module>(new[] {
         expectedModule
     });
     var actualModule = container.FindModuleContainingPath("~/test");
     actualModule.ShouldBeSameAs(expectedModule);
 }
Esempio n. 2
0
 public void FindModuleContainingPathWithWrongPathReturnsNull()
 {
     var container = new ModuleContainer<Module>(new[] {
         new Module("~/test")
     });
     var actualModule = container.FindModuleContainingPath("~/WRONG");
     actualModule.ShouldBeNull();
 }
Esempio n. 3
0
 public void FindModuleContainingPathOfAssetReturnsTheModule()
 {
     var expectedModule = new Module("~/test");
     var asset = new Mock<IAsset>();
     asset.Setup(a => a.Accept(It.IsAny<IAssetVisitor>()))
          .Callback<IAssetVisitor>(v => v.Visit(asset.Object));
     asset.SetupGet(a => a.SourceFilename).Returns("~/test/test.js");
     expectedModule.Assets.Add(asset.Object);
     var container = new ModuleContainer<Module>(new[] {
         expectedModule
     });
     var actualModule = container.FindModuleContainingPath("~/test/test.js");
     actualModule.ShouldBeSameAs(expectedModule);
 }