public void FindModuleContainingPathOfModuleReturnsTheModule() { var expectedModule = new Module("~/test"); var container = new ModuleContainer<Module>(new[] { expectedModule }); var actualModule = container.FindModuleContainingPath("~/test"); actualModule.ShouldBeSameAs(expectedModule); }
public void FindModuleContainingPathWithWrongPathReturnsNull() { var container = new ModuleContainer<Module>(new[] { new Module("~/test") }); var actualModule = container.FindModuleContainingPath("~/WRONG"); actualModule.ShouldBeNull(); }
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); }