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(); }
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(); }
protected void setUpAssembly() { if (!Directory.Exists(servePath)) Directory.CreateDirectory(servePath); var c = new TestsCompiler() .StoreAssemblyAs(Path.Combine(servePath, assemblyFileName)) .With<AssemblyWithSingleDownload>(); }
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(); }
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 } }
public void WhenEntryPointNotFoundExceptionIsThrown() { var c = new TestsCompiler().With<AttributesOnly>(); new Publisher(new PublishingOptions(c.Assembly)); }
public void MultipleEntryPointsThrow() { var c = new TestsCompiler().With(new MultiEntryPoint() + "EntryPoint2.cs"); new Publisher(new PublishingOptions(c.Assembly)); }