コード例 #1
0
        public void AddRuntimeDependency_NoMirrorSyntax_Throws()
        {
            var uut = new Recipe();

            Assert.Throws <InvalidOperationException>(() =>
            {
                uut.AddRuntimeDependency("SomeDependency");
            });

            Assert.False(uut.HasRuntimeDependencies);
        }
コード例 #2
0
        public void AddRuntimeDependency_Success()
        {
            var uut = new Recipe(
                new ValueTable(
                    new Dictionary <string, IValue>()
            {
                { "Name", new Value("TestProject") },
                { "Language", new Value("C#") },
            },
                    new DocumentSyntax()));

            uut.AddRuntimeDependency("SomeDependency");

            Assert.True(uut.HasRuntimeDependencies);
            Assert.Equal(
                new List <PackageReference>()
            {
                new PackageReference(new Path("SomeDependency")),
            },
                uut.RuntimeDependencies);
        }