diff --git a/src/TeamCitySharp/ActionTypes/Agents.cs b/src/TeamCitySharp/ActionTypes/Agents.cs index 3bfe05f1..f5de86af 100644 --- a/src/TeamCitySharp/ActionTypes/Agents.cs +++ b/src/TeamCitySharp/ActionTypes/Agents.cs @@ -32,17 +32,5 @@ public List All(bool includeDisconnected = true, bool includeUnauthorized return agentWrapper.Agent; } - - private string AddqueryString(string url, string queryString) - { - if (url.Contains("?")) - url += "&"; - else - url += "?"; - - url += queryString; - - return url; } - } } \ No newline at end of file diff --git a/src/Tests/IntegrationTests/Properties/AssemblyInfo.cs b/src/Tests/IntegrationTests/Properties/AssemblyInfo.cs index 01bf5c70..cd29004c 100644 --- a/src/Tests/IntegrationTests/Properties/AssemblyInfo.cs +++ b/src/Tests/IntegrationTests/Properties/AssemblyInfo.cs @@ -5,6 +5,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. + [assembly: AssemblyTitle("IntegrationTests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -17,9 +18,11 @@ // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM + [assembly: Guid("904b02b8-18c4-4df0-9cf8-6fc55c0ada71")] // Version information for an assembly consists of the following four values: @@ -32,5 +35,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] + [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/src/Tests/IntegrationTests/SampleConnectionUsage.cs b/src/Tests/IntegrationTests/SampleConnectionUsage.cs index 88750cb1..3c9c2ee1 100644 --- a/src/Tests/IntegrationTests/SampleConnectionUsage.cs +++ b/src/Tests/IntegrationTests/SampleConnectionUsage.cs @@ -3,52 +3,52 @@ namespace TeamCitySharp.IntegrationTests { - [TestFixture] - public class when_connecting_to_the_teamcity_server + [TestFixture] + public class when_connecting_to_the_teamcity_server + { + private ITeamCityClient _client; + + [SetUp] + public void SetUp() { - private ITeamCityClient _client; - - [SetUp] - public void SetUp() - { - _client = new TeamCityClient("localhost:81"); - _client = new TeamCityClient("vmmobuild01"); - } - - [Test] - public void it_will_authenticate_a_known_user() - { - _client.Connect("admin", "qwerty"); - - Assert.That(_client.Authenticate()); - } - - [Test] - [ExpectedException(typeof(AuthenticationException))] - public void it_will_throw_an_exception_for_an_unknown_user() - { - _client.Connect("smithy", "smithy"); - _client.Authenticate(); - - //Assert.Throws Exception - } - [Test] - public void it_will_authenticate_a_known_user_throwExceptionOnHttpError() - { - _client.Connect("admin", "qwerty"); - - Assert.That(_client.Authenticate(false)); - } - - [Test] - public void it_will_throw_an_exception_for_an_unknown_user_throwExceptionOnHttpError() - { - _client.Connect("smithy", "smithy"); - Assert.IsFalse(_client.Authenticate(false)); - - - //Assert.Throws Exception - } + _client = new TeamCityClient("localhost:81"); + _client = new TeamCityClient("vmmobuild01"); + } + + [Test] + public void it_will_authenticate_a_known_user() + { + _client.Connect("admin", "qwerty"); + + Assert.That(_client.Authenticate()); + } + + [Test] + [ExpectedException(typeof (AuthenticationException))] + public void it_will_throw_an_exception_for_an_unknown_user() + { + _client.Connect("smithy", "smithy"); + _client.Authenticate(); + + //Assert.Throws Exception + } + + [Test] + public void it_will_authenticate_a_known_user_throwExceptionOnHttpError() + { + _client.Connect("admin", "qwerty"); + + Assert.That(_client.Authenticate(false)); + } + + [Test] + public void it_will_throw_an_exception_for_an_unknown_user_throwExceptionOnHttpError() + { + _client.Connect("smithy", "smithy"); + Assert.IsFalse(_client.Authenticate(false)); + + //Assert.Throws Exception } -} + } +} \ No newline at end of file diff --git a/src/Tests/IntegrationTests/TeamCitySharp.IntegrationTests.csproj b/src/Tests/IntegrationTests/TeamCitySharp.IntegrationTests.csproj index 532cb202..03278016 100644 --- a/src/Tests/IntegrationTests/TeamCitySharp.IntegrationTests.csproj +++ b/src/Tests/IntegrationTests/TeamCitySharp.IntegrationTests.csproj @@ -86,4 +86,4 @@ --> - + \ No newline at end of file diff --git a/src/Tests/IntegrationTests/packages.config b/src/Tests/IntegrationTests/packages.config index 4fc2abcd..3f6c113a 100644 --- a/src/Tests/IntegrationTests/packages.config +++ b/src/Tests/IntegrationTests/packages.config @@ -1,4 +1,5 @@  + - + \ No newline at end of file diff --git a/src/Tests/UnitTests/ActionTypes/ServerInformationTest.cs b/src/Tests/UnitTests/ActionTypes/ServerInformationTest.cs index 0690cefc..ff6c2f4a 100644 --- a/src/Tests/UnitTests/ActionTypes/ServerInformationTest.cs +++ b/src/Tests/UnitTests/ActionTypes/ServerInformationTest.cs @@ -1,63 +1,64 @@ namespace TeamCitySharp.ActionTypes { - using FakeItEasy; - using FluentAssertions; - using NUnit.Framework; - using TeamCitySharp.Connection; + using FakeItEasy; + using FluentAssertions; + using NUnit.Framework; + using TeamCitySharp.Connection; - [TestFixture] - public class ServerInformationTest + [TestFixture] + public class ServerInformationTest + { + private ServerInformation testee; + private ITeamCityCaller teamCityCaller; + + [SetUp] + public void SetUp() { - private ServerInformation testee; - private ITeamCityCaller teamCityCaller; + this.teamCityCaller = A.Fake(); + this.testee = new ServerInformation(this.teamCityCaller); + } - [SetUp] - public void SetUp() - { - this.teamCityCaller = A.Fake(); - this.testee = new ServerInformation(this.teamCityCaller); - } - - [TestCase(true, true, true, true)] - [TestCase(false, false, false, false)] - [TestCase(true, false, false, false)] - [TestCase(false, true, false, false)] - [TestCase(false, false, true, false)] - [TestCase(false, false, false, true)] - public void CreatesBackupWithSelectedParts(bool includeBuildLogs, bool includeConfigurations, bool includeDatabase, bool includePersonalChanges) - { - const string Filename = "Filename"; - var backupOptions = new BackupOptions - { - Filename = Filename, - IncludeBuildLogs = includeBuildLogs, - IncludeConfigurations = includeConfigurations, - IncludeDatabase = includeDatabase, - IncludePersonalChanges = includePersonalChanges - }; - - this.testee.TriggerServerInstanceBackup(backupOptions); - - A.CallTo(() => this.teamCityCaller.StartBackup(string.Concat( - "/app/rest/server/backup?fileName=", - Filename, - "&includeBuildLogs=" + includeBuildLogs, - "&includeConfigs=" + includeConfigurations, - "&includeDatabase=" + includeDatabase, - "&includePersonalChanges=" + includePersonalChanges))) - .MustHaveHappened(); - } - - [Test] - public void GetsBackupStatus() + [TestCase(true, true, true, true)] + [TestCase(false, false, false, false)] + [TestCase(true, false, false, false)] + [TestCase(false, true, false, false)] + [TestCase(false, false, true, false)] + [TestCase(false, false, false, true)] + public void CreatesBackupWithSelectedParts(bool includeBuildLogs, bool includeConfigurations, bool includeDatabase, + bool includePersonalChanges) + { + const string Filename = "Filename"; + var backupOptions = new BackupOptions { - const string Status = "Idle"; + Filename = Filename, + IncludeBuildLogs = includeBuildLogs, + IncludeConfigurations = includeConfigurations, + IncludeDatabase = includeDatabase, + IncludePersonalChanges = includePersonalChanges + }; + + this.testee.TriggerServerInstanceBackup(backupOptions); + + A.CallTo(() => this.teamCityCaller.StartBackup(string.Concat( + "/app/rest/server/backup?fileName=", + Filename, + "&includeBuildLogs=" + includeBuildLogs, + "&includeConfigs=" + includeConfigurations, + "&includeDatabase=" + includeDatabase, + "&includePersonalChanges=" + includePersonalChanges))) + .MustHaveHappened(); + } + + [Test] + public void GetsBackupStatus() + { + const string Status = "Idle"; - A.CallTo(() => this.teamCityCaller.GetRaw("/app/rest/server/backup")).Returns(Status); + A.CallTo(() => this.teamCityCaller.GetRaw("/app/rest/server/backup")).Returns(Status); - string status = this.testee.GetBackupStatus(); + string status = this.testee.GetBackupStatus(); - status.Should().Be(Status); - } + status.Should().Be(Status); } -} \ No newline at end of file + } +} diff --git a/src/Tests/UnitTests/Properties/AssemblyInfo.cs b/src/Tests/UnitTests/Properties/AssemblyInfo.cs index 6d4e1f54..5e7ac8fc 100644 --- a/src/Tests/UnitTests/Properties/AssemblyInfo.cs +++ b/src/Tests/UnitTests/Properties/AssemblyInfo.cs @@ -5,6 +5,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. + [assembly: AssemblyTitle("TeamCitySharp.UnitTests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -17,9 +18,11 @@ // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM + [assembly: Guid("ffe7fbda-d6b9-459f-9b4d-a8d7858bd053")] // Version information for an assembly consists of the following four values: @@ -32,5 +35,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] + [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/src/Tests/UnitTests/TeamCitySharp.UnitTests.csproj b/src/Tests/UnitTests/TeamCitySharp.UnitTests.csproj index 771622ce..bf1e2c49 100644 --- a/src/Tests/UnitTests/TeamCitySharp.UnitTests.csproj +++ b/src/Tests/UnitTests/TeamCitySharp.UnitTests.csproj @@ -73,4 +73,4 @@ --> - + \ No newline at end of file diff --git a/src/Tests/UnitTests/packages.config b/src/Tests/UnitTests/packages.config index 5feb10d9..3a11f83d 100644 --- a/src/Tests/UnitTests/packages.config +++ b/src/Tests/UnitTests/packages.config @@ -1,6 +1,7 @@  + - + \ No newline at end of file