Пример #1
0
        public void It_can_have_assets_added_to_it()
        {
            var directoryAccessor = new InMemoryDirectoryAccessor();

            var package = new Package2("the-package", directoryAccessor);

            var projectAsset = new ProjectAsset(directoryAccessor);

            package.Add(projectAsset);

            package.Assets.Should().Contain(a => a == projectAsset);
        }
Пример #2
0
        public void An_asset_must_be_in_a_subdirectory_of_the_package()
        {
            var directoryAccessor = new InMemoryDirectoryAccessor();

            var package = new Package2("1", directoryAccessor.GetDirectoryAccessorForRelativePath("1"));

            var projectAsset = new ProjectAsset(directoryAccessor.GetDirectoryAccessorForRelativePath("2"));

            package.Invoking(p => p.Add(projectAsset)).Should()
            .Throw <ArgumentException>()
            .And
            .Message
            .Should()
            .StartWith("Asset must be located under package path");
        }