Beispiel #1
0
 public void PublisherIsProvidedToPublishedItem()
 {
     var pMock = new Mock<IPublisher>();
     pMock.Setup(p => p.SetupMetadata(It.IsAny<Action<IMetadataInlet>>())).Returns(pMock.Object);
     var c = new TestsCompiler().With<AttributeAndEntryPoint>();
     new Publisher(new PublishingOptions(c.Assembly) { CustomPublisher = pMock.Object });
     pMock.Verify();
 }
Beispiel #2
0
 public void PublishingOptionsConvertsFileToAssembly()
 {
     var c = new TestsCompiler()
       .StoreAssemblyAs("PublishingOptionsConvertsFileToAssembly.dll")
       .With<AssemblyWithSingleDownload>();
     var options = new PublishingOptions { PathToAssembly = "PublishingOptionsConvertsFileToAssembly.dll" };
     var ass = options.EntryAssembly;
     ass.ShouldNotBeNull();
 }
Beispiel #3
0
        protected void setUpAssembly()
        {
            if (!Directory.Exists(servePath))
                Directory.CreateDirectory(servePath);

            var c = new TestsCompiler()
              .StoreAssemblyAs(Path.Combine(servePath, assemblyFileName))
              .With<AssemblyWithSingleDownload>();
        }
Beispiel #4
0
        public void TheTorrentsDefaultNameIsTheProductName()
        {
            var c = new TestsCompiler()
              .StoreAssemblyAs("defaultName.dll")
              .With<AssemblyWithSingleDownload>();

            string contentPath = Path.Combine(Environment.CurrentDirectory, "defaultName.dll");
            var p = new Publisher(
                new PublishingOptions
                {
                    Content = contentPath,
                    PathToAssembly = contentPath,
                    RunInSeparateAppDomain = true
                });
            File.Exists("acme stuff.torrent").ShouldBeTrue();
        }
Beispiel #5
0
 public void TheEntryPointIsFound()
 {
     try
     {
         var c = new TestsCompiler().With<AttributeAndEntryPoint>();
         new Publisher(new PublishingOptions(c.Assembly));
     }
     catch (EntryPointNotFoundException x)
     {
         Assert.Fail("Entry point was not found: {0}", x.Message);
     }
     catch (EmptyBinException)
     {
         // Irrelevant for this test
     }
 }
Beispiel #6
0
 public void WhenEntryPointNotFoundExceptionIsThrown()
 {
     var c = new TestsCompiler().With<AttributesOnly>();
     new Publisher(new PublishingOptions(c.Assembly));
 }
Beispiel #7
0
 public void MultipleEntryPointsThrow()
 {
     var c = new TestsCompiler().With(new MultiEntryPoint() + "EntryPoint2.cs");
     new Publisher(new PublishingOptions(c.Assembly));
 }