Inheritance: ApplicationCommand
Exemplo n.º 1
0
        public void ShouldWriteIfNoBuildsExists(BuildCommand command,
			[Frozen]Mock<TextWriter> writer, string applicationId)
        {
            command.Execute(new string[0]);

            writer.Verify(x => x.WriteLine("No builds are associated with this application."));
        }
Exemplo n.º 2
0
        public void ShouldOutputBuilds([Frozen]Mock<IApplicationConfiguration> applicationConfiguration,
			[Frozen]Mock<IAppHarborClient> client,
			[Frozen]Mock<TextWriter> writer,
			BuildCommand command, string applicationId)
        {
            applicationConfiguration.Setup(x => x.GetApplicationId()).Returns(applicationId);
            var builds = new List<Build>
            {
                new Build { Commit = new Commit { Message = "foo bar", Id = "baz" }, Status = "Failed", Deployed = DateTime.Now },
            };

            client.Setup(x => x.GetBuilds(applicationId)).Returns(builds);

            Assert.DoesNotThrow(() => command.Execute(new string[0]));
        }