Example #1
0
 public override void PublishesSolutionSyncing()
 {
     Assert.That(
         () => this.publisher.PublishSolutionSyncing(),
         Does.RaiseWith <ISolutionSyncStatus>(_ => this.publisher.SolutionSyncing += _)
         .WithArgWhere(status => status.AbortSync, Is.False));
 }
Example #2
0
        public override void PublishesCsprojGenerated()
        {
            var fileArg = new GeneratedFile(new FileInfo(this.testArgs.CsprojPath), this.testArgs.CsprojContent);

            Assert.That(
                () => this.publisher.PublishCsprojGenerated(this.testArgs.CsprojPath, this.testArgs.CsprojContent),
                Does.RaiseWith <IGeneratedFile>(_ => this.publisher.CsprojGenerated += _)
                .WithArgThat(Is.EqualTo(fileArg).Using(new GeneratedFileEqualityComparer())));
        }
Example #3
0
        public void PublishSlnGeneratedReturnsModifiedContent()
        {
            string returnedContent = null;

            Assume.That(
                () => returnedContent = this.publisher.PublishSlnGenerated(
                    this.testArgs.SlnPath,
                    this.testArgs.SlnContent),
                Does.RaiseWith <IGeneratedFile>(_ => this.publisher.SlnGenerated += _ + ModifyContent));
            Assert.That(returnedContent, Is.EqualTo(SomeModifiedContent));
        }
Example #4
0
        public void PublishSolutionSyncingReturnsUpdatedStatus()
        {
            bool returnedAbortStatus = false;

            void AbortSync(ISolutionSyncStatus status) => status.AbortSync = true;

            Assume.That(
                () => returnedAbortStatus = this.publisher.PublishSolutionSyncing(),
                Does.RaiseWith <ISolutionSyncStatus>(_ => this.publisher.SolutionSyncing += _ + AbortSync));
            Assert.That(returnedAbortStatus, Is.True);
        }