├── .gitignore ├── License.txt ├── README.md ├── TeamCitySharp.sln ├── packages ├── EasyHttp.1.6.1.0 │ ├── EasyHttp.1.6.1.0.nupkg │ └── lib │ │ ├── net40 │ │ └── EasyHttp.dll │ │ ├── sl40-wp │ │ └── EasyHttp.dll │ │ └── sl40 │ │ └── EasyHttp.dll ├── FakeItEasy.1.10.0 │ ├── FakeItEasy.1.10.0.nupkg │ ├── FakeItEasy.1.10.0.nuspec │ └── lib │ │ ├── net35 │ │ ├── FakeItEasy.dll │ │ └── FakeItEasy.xml │ │ ├── net40 │ │ ├── FakeItEasy.dll │ │ └── FakeItEasy.xml │ │ └── sl40 │ │ ├── FakeItEasy.dll │ │ └── FakeItEasy.xml ├── FluentAssertions.2.0.1 │ ├── FluentAssertions.2.0.1.nupkg │ ├── FluentAssertions.2.0.1.nuspec │ └── lib │ │ ├── net35 │ │ ├── FluentAssertions.dll │ │ ├── FluentAssertions.pdb │ │ └── FluentAssertions.xml │ │ ├── net40 │ │ ├── FluentAssertions.dll │ │ ├── FluentAssertions.pdb │ │ └── FluentAssertions.xml │ │ ├── net45 │ │ ├── FluentAssertions.dll │ │ ├── FluentAssertions.pdb │ │ └── FluentAssertions.xml │ │ ├── sl4-windowsphone71 │ │ ├── FluentAssertions.WindowsPhone.dll │ │ ├── FluentAssertions.WindowsPhone.pdb │ │ └── FluentAssertions.WindowsPhone.xml │ │ ├── sl4 │ │ ├── FluentAssertions.Silverlight.dll │ │ ├── FluentAssertions.Silverlight.pdb │ │ ├── FluentAssertions.Silverlight.xml │ │ ├── Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll │ │ ├── Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.pdb │ │ └── Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.xml │ │ └── winrt45 │ │ ├── FluentAssertions.dll │ │ ├── FluentAssertions.pdb │ │ └── FluentAssertions.xml ├── JsonFx.2.0.1209.2802 │ ├── JsonFx.2.0.1209.2802.nupkg │ ├── JsonFx.2.0.1209.2802.nuspec │ └── lib │ │ ├── net20 │ │ ├── JsonFx.dll │ │ └── JsonFx.xml │ │ ├── net35 │ │ ├── JsonFx.dll │ │ └── JsonFx.xml │ │ ├── net40 │ │ ├── JsonFx.dll │ │ └── JsonFx.xml │ │ ├── sl35 │ │ ├── JsonFx.dll │ │ └── JsonFx.xml │ │ ├── sl40-wp │ │ ├── JsonFx.dll │ │ └── JsonFx.xml │ │ ├── sl40 │ │ ├── JsonFx.dll │ │ └── JsonFx.xml │ │ └── wp40 │ │ ├── JsonFx.dll │ │ └── JsonFx.xml ├── NUnit.2.5.10.11092 │ ├── Logo.ico │ ├── NUnit.2.5.10.11092.nupkg │ ├── NUnitFitTests.html │ ├── fit-license.txt │ ├── lib │ │ ├── nunit.framework.dll │ │ ├── nunit.framework.xml │ │ ├── nunit.mocks.dll │ │ └── pnunit.framework.dll │ ├── license.txt │ └── tools │ │ ├── NUnitTests.VisualState.xml │ │ ├── NUnitTests.config │ │ ├── NUnitTests.nunit │ │ ├── TestResult.xml │ │ ├── agent.conf │ │ ├── agent.log.conf │ │ ├── launcher.log.conf │ │ ├── lib │ │ ├── Failure.png │ │ ├── Ignored.png │ │ ├── Inconclusive.png │ │ ├── Skipped.png │ │ ├── Success.png │ │ ├── fit.dll │ │ ├── log4net.dll │ │ ├── nunit-console-runner.dll │ │ ├── nunit-gui-runner.dll │ │ ├── nunit.core.dll │ │ ├── nunit.core.interfaces.dll │ │ ├── nunit.fixtures.dll │ │ ├── nunit.uiexception.dll │ │ ├── nunit.uikit.dll │ │ └── nunit.util.dll │ │ ├── nunit-agent-x86.exe │ │ ├── nunit-agent-x86.exe.config │ │ ├── nunit-agent.exe │ │ ├── nunit-agent.exe.config │ │ ├── nunit-console-x86.exe │ │ ├── nunit-console-x86.exe.config │ │ ├── nunit-console.exe │ │ ├── nunit-console.exe.config │ │ ├── nunit-x86.exe │ │ ├── nunit-x86.exe.config │ │ ├── nunit.exe │ │ ├── nunit.exe.config │ │ ├── nunit.framework.dll │ │ ├── pnunit-agent.exe │ │ ├── pnunit-agent.exe.config │ │ ├── pnunit-launcher.exe │ │ ├── pnunit-launcher.exe.config │ │ ├── pnunit.framework.dll │ │ ├── pnunit.tests.dll │ │ ├── runFile.exe │ │ ├── runFile.exe.config │ │ ├── runpnunit.bat │ │ └── test.conf ├── NUnit.2.6.2 │ ├── NUnit.2.6.2.nupkg │ ├── NUnit.2.6.2.nuspec │ ├── lib │ │ ├── nunit.framework.dll │ │ └── nunit.framework.xml │ └── license.txt └── repositories.config └── src ├── TeamCitySharp ├── ActionTypes │ ├── Agents.cs │ ├── BackupOptions.cs │ ├── BuildArtifacts.cs │ ├── BuildConfigs.cs │ ├── Builds.cs │ ├── Changes.cs │ ├── IAgents.cs │ ├── IBuildArtifacts.cs │ ├── IBuildConfigs.cs │ ├── IBuilds.cs │ ├── IChanges.cs │ ├── IProjects.cs │ ├── IServerInformation.cs │ ├── IUsers.cs │ ├── IVcsRoots.cs │ ├── Projects.cs │ ├── ServerInformation.cs │ ├── Users.cs │ └── VcsRoots.cs ├── App.config ├── Connection │ ├── IClientConnection.cs │ ├── ITeamCityCaller.cs │ ├── TeamCityCaller.cs │ ├── TeamCityDateFilter.cs │ └── TeamcityJsonEncoderDecoderConfiguration.cs ├── DomainEntities │ ├── Agent.cs │ ├── AgentRequirement.cs │ ├── AgentRequirements.cs │ ├── AgentWrapper.cs │ ├── ArtifactDependencies.cs │ ├── ArtifactDependency.cs │ ├── Build.cs │ ├── BuildConfig.cs │ ├── BuildStep.cs │ ├── BuildSteps.cs │ ├── BuildTrigger.cs │ ├── BuildTriggers.cs │ ├── BuildTypeWrapper.cs │ ├── BuildWrapper.cs │ ├── Change.cs │ ├── ChangeWrapper.cs │ ├── Credentials.cs │ ├── File.cs │ ├── FileWrapper.cs │ ├── Group.cs │ ├── IBaseEntity.cs │ ├── Parameters.cs │ ├── Plugin.cs │ ├── PluginWrapper.cs │ ├── Project.cs │ ├── ProjectWrapper.cs │ ├── Properties.cs │ ├── Property.cs │ ├── Role.cs │ ├── RoleWrapper.cs │ ├── Server.cs │ ├── SnapshotDependencies.cs │ ├── SnapshotDependency.cs │ ├── User.cs │ ├── UserGroupWrapper.cs │ ├── UserWrapper.cs │ ├── VcsRoot.cs │ ├── VcsRootEntries.cs │ ├── VcsRootEntry.cs │ ├── VcsRootField.cs │ └── VcsRootWrapper.cs ├── ITeamCityClient.cs ├── Locators │ ├── BuildLocator.cs │ ├── BuildTypeLocator.cs │ └── UserLocator.cs ├── Properties │ └── AssemblyInfo.cs ├── TeamCityClient.cs ├── TeamCitySharp.csproj └── packages.config └── Tests ├── IntegrationTests ├── App.config ├── Properties │ └── AssemblyInfo.cs ├── SampleAgentUsage.cs ├── SampleBuildsConfigsUsage.cs ├── SampleBuildsUsage.cs ├── SampleChangeUsage.cs ├── SampleConnectionUsage.cs ├── SampleCreateUser.cs ├── SampleProjectUsage.cs ├── SampleServerUsage.cs ├── SampleUserUsage.cs ├── SampleVcsUsage.cs ├── TeamCitySharp.IntegrationTests.csproj └── packages.config └── UnitTests ├── ActionTypes └── ServerInformationTest.cs ├── Properties └── AssemblyInfo.cs ├── TeamCitySharp.UnitTests.csproj └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | bin 3 | deploy 4 | *.csproj.user 5 | *.suo 6 | *ReSharper* 7 | *.orig 8 | *.dotCover 9 | output 10 | *.TeamCitySharp.sln.metaproj* 11 | *.DotSettings.* 12 | nuget 13 | Package -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | License: http://stack72.mit-license.org/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **No longer maintained! Please use https://github.com/mavezeau/TeamCitySharp** 2 | -------------------------------------------------------------------------------- /TeamCitySharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{263F35DD-20C1-4209-B121-E962C9328C70}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCitySharp.IntegrationTests", "src\Tests\IntegrationTests\TeamCitySharp.IntegrationTests.csproj", "{BA409A09-CC7B-4A71-A3D4-FE27234A721B}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCitySharp", "src\TeamCitySharp\TeamCitySharp.csproj", "{87598714-132F-478E-866E-8C1AF3E83057}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCitySharp.UnitTests", "src\Tests\UnitTests\TeamCitySharp.UnitTests.csproj", "{1DA175C4-2A6F-4B52-A9B4-87D382150AE9}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|Mixed Platforms = Debug|Mixed Platforms 16 | Debug|x86 = Debug|x86 17 | Release|Any CPU = Release|Any CPU 18 | Release|Mixed Platforms = Release|Mixed Platforms 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 25 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 26 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Debug|x86.ActiveCfg = Debug|Any CPU 27 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 30 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Release|Mixed Platforms.Build.0 = Release|Any CPU 31 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B}.Release|x86.ActiveCfg = Release|Any CPU 32 | {87598714-132F-478E-866E-8C1AF3E83057}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {87598714-132F-478E-866E-8C1AF3E83057}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {87598714-132F-478E-866E-8C1AF3E83057}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 35 | {87598714-132F-478E-866E-8C1AF3E83057}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 36 | {87598714-132F-478E-866E-8C1AF3E83057}.Debug|x86.ActiveCfg = Debug|Any CPU 37 | {87598714-132F-478E-866E-8C1AF3E83057}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 | {87598714-132F-478E-866E-8C1AF3E83057}.Release|Any CPU.Build.0 = Release|Any CPU 39 | {87598714-132F-478E-866E-8C1AF3E83057}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 40 | {87598714-132F-478E-866E-8C1AF3E83057}.Release|Mixed Platforms.Build.0 = Release|Any CPU 41 | {87598714-132F-478E-866E-8C1AF3E83057}.Release|x86.ActiveCfg = Release|Any CPU 42 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 45 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 46 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Debug|x86.ActiveCfg = Debug|Any CPU 47 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Release|Any CPU.ActiveCfg = Release|Any CPU 48 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Release|Any CPU.Build.0 = Release|Any CPU 49 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 50 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Release|Mixed Platforms.Build.0 = Release|Any CPU 51 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9}.Release|x86.ActiveCfg = Release|Any CPU 52 | EndGlobalSection 53 | GlobalSection(SolutionProperties) = preSolution 54 | HideSolutionNode = FALSE 55 | EndGlobalSection 56 | GlobalSection(NestedProjects) = preSolution 57 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B} = {263F35DD-20C1-4209-B121-E962C9328C70} 58 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9} = {263F35DD-20C1-4209-B121-E962C9328C70} 59 | EndGlobalSection 60 | EndGlobal 61 | -------------------------------------------------------------------------------- /packages/EasyHttp.1.6.1.0/EasyHttp.1.6.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/EasyHttp.1.6.1.0/EasyHttp.1.6.1.0.nupkg -------------------------------------------------------------------------------- /packages/EasyHttp.1.6.1.0/lib/net40/EasyHttp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/EasyHttp.1.6.1.0/lib/net40/EasyHttp.dll -------------------------------------------------------------------------------- /packages/EasyHttp.1.6.1.0/lib/sl40-wp/EasyHttp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/EasyHttp.1.6.1.0/lib/sl40-wp/EasyHttp.dll -------------------------------------------------------------------------------- /packages/EasyHttp.1.6.1.0/lib/sl40/EasyHttp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/EasyHttp.1.6.1.0/lib/sl40/EasyHttp.dll -------------------------------------------------------------------------------- /packages/FakeItEasy.1.10.0/FakeItEasy.1.10.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FakeItEasy.1.10.0/FakeItEasy.1.10.0.nupkg -------------------------------------------------------------------------------- /packages/FakeItEasy.1.10.0/FakeItEasy.1.10.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FakeItEasy 5 | 1.10.0 6 | Fake it Easy! 7 | Patrik Hägne 8 | Patrik Hägne 9 | https://github.com/FakeItEasy/FakeItEasy/blob/master/License.txt 10 | https://github.com/FakeItEasy/FakeItEasy/ 11 | https://raw.github.com/FakeItEasy/FakeItEasy/master/Resources/fakeiteasy_128x128.png 12 | false 13 | It's faking amazing! The easy mocking framework for .NET that works great in C# and VB.NET alike. No need to know the difference between a stub, a mock or a spy, everything's a fake! The easy to use, refactoring friendly API makes faking a breeze. 14 | Enhancement: Add EndsWith to complement StartsWith - https://github.com/FakeItEasy/FakeItEasy/issues/84/ 15 | Enhancement: Upgrade to Castle.Core 3.2.0 - https://github.com/FakeItEasy/FakeItEasy/issues/59/ 16 | Bug: Fake config fails when 2 interfaces both declare the member - https://github.com/FakeItEasy/FakeItEasy/issues/83/ 17 | en-US 18 | TDD unittesting mocking faking stubbing spy spies doubles 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /packages/FakeItEasy.1.10.0/lib/net35/FakeItEasy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FakeItEasy.1.10.0/lib/net35/FakeItEasy.dll -------------------------------------------------------------------------------- /packages/FakeItEasy.1.10.0/lib/net40/FakeItEasy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FakeItEasy.1.10.0/lib/net40/FakeItEasy.dll -------------------------------------------------------------------------------- /packages/FakeItEasy.1.10.0/lib/sl40/FakeItEasy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FakeItEasy.1.10.0/lib/sl40/FakeItEasy.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/FluentAssertions.2.0.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/FluentAssertions.2.0.1.nupkg -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/FluentAssertions.2.0.1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FluentAssertions 5 | 2.0.1 6 | Fluent Assertions 7 | Dennis Doomen, Martin Opdam 8 | Dennis Doomen, Martin Opdam 9 | http://fluentassertions.codeplex.com/license 10 | http://fluentassertions.codeplex.com/ 11 | false 12 | A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or 13 | BDD-style unit test. Runs on .NET 3.5, 4.0 and 4.5 (Desktop and Windows Store), Silverlight 4 and 5 and Windows Phone 7.5. Supports the unit test frameworks NUnit, XUnit, MBUnit, Gallio and MSpec. 14 | Fluent methods for asserting the result of TDD/BDD specs for .NET 3.5/4.0/4.5 (Desktop and Windows Store), SL 4/5, WP7 (Mango). Supports the unit test frameworks NUnit, XUnit, MBUnit, Gallio and MSpec. 15 | What's new in 2.0.1 16 | * Small bug-fix to better intercept and/or prevent exceptions while scanning for methods annotated with [ValueFormatter] 17 | 18 | What are the major features 19 | * Added support for .NET 4.5, Windows Phone 7.5 and .NET for Windows Store Apps 20 | * Added support for MBUnit and the Gallio framework 21 | * Added a completely new extensible API for comparing two objects graph for equivalence that will replace the object.ShouldHave() API in the future (issue 11841). 22 | 23 | What's new for collections 24 | * Added (Not)BeInAscendingOrder() and (Not)BeInDescendingOrder() (issue 12103) 25 | * Added IntersectWith(otherCollection) and NotIntersectWith(otherCollection) (issue 12248) 26 | * ContainInOrder() now has an overload that only takes a params object[] argument to support a more fluent syntax in case you don't specify the reason (issue 12313). 27 | * Added ContainSingle(Expression<Func<T, bool=""> predicate>) that asserts there is only a single element in the collection that matches the specified predicate (issue 12313). 28 | * Added support for a lambda that is used for checking the equality of two collections (issue 11925). 29 | * Fixed a bug that occurs when two collections are compared for equality but the collection contains null (issue 12296) 30 | 31 | What's new for strings 32 | * When strings differ in length, it will report the expected and actual lengths as part of the failure messages (issue 12422) 33 | * An ArgumentOutOfRangeException was thrown when asserting a string started with a specific string, but the first string was shorter than the expected string (issue 12293) 34 | 35 | What's new for numbers 36 | * Added support for using Should().Be() on nullable numeric types (issue 11837) 37 | * Added BeOneOf() to verify that the value matching one of the provided values (issue 12016). 38 | * Added support for (nullable) decimals 39 | * BePositive() and BeNegative() now also work for floats and doubles (issue 11946) 40 | 41 | What's new for dates and times 42 | * Added NotBe() 43 | * Added BeOneOf() to verify that the value matching one of the provided values (issue 12016). 44 | * Added BeCloseTo() to assert that a datetime is within a specified number of milliseconds from another datetime value. Usefull for example when your database truncates datetime values (issue 12070). 45 | * If a DateTime value has milliseconds then they will be displayed in an assertion failure message (issue 12072). 46 | 47 | What's new for comparing object graphs 48 | * You can now apply the property equality comparisons to entire collections of objects. It doesn't matter what kind of collections types you use, as long as they contain the same number of objects which properties are the same (issue 11743). 49 | * Included the index of the mismatching object when comparing a collection for structural equality 50 | * An exception was thrown when comparing the properties of an object, and there were cyclic references. You can now configure if you want this to be ignored. 51 | * Added support for comparing references to an interface rather than concrete types (issue 11840). 52 | * Write-only properties are ignored (issue 11808) 53 | * Fixed a stack overflow exception when formatting an object graph containing static cyclic references. 54 | * Fixed an exception that was thrown when formatting an object graph where one of the properties threw an exception. 55 | * Added support for comparing two anonymous types using SharedProperties() (issue 11886). 56 | * The name of a DateTime property was not included in the error message when AllProperties() failed on that property 57 | 58 | What's new for types 59 | * Added the AllTypes class with a static method From(Assembly assembly) as a wrapper around the Types extension method on Assembly (issue 12186). This allows for a more fluent syntax like AllTypes.From(assembly).ThatImplement<SomeInterface>().Should().BeDecoratedWith<SomeAttribute>(); 60 | * Added support for asserting the properties of an attribute have a specific value (issue 12186). 61 | 62 | What other improvements are new 63 | * Fixed an exception when asserting equality of dictionaries that contain nulls (issue 12004). 64 | * The NuGet package will automatically add references to System.Xml and System.Xml.Linq 65 | * Implemented ShouldThrow<TException>() for Func<Task>, to support working with async methods (issue 12148) 66 | * Improved several error messages in XDocument- and XElementAssertions 67 | * All overloads that take a reason have been removed and replaced with optional parameter 68 | * Allowed ShouldRaisePropertyChangeFor(null) to verify that the INotifyPropertyChanged was raised for all properties. 69 | * The list of ValueFormatters on the Verification class can be changed to insert a custom formatter. 70 | * Introduced a mechanism to override the way FA formats objects in failure message by annotating a static method with the [ValueFormatter] attribute (issue 12364). 71 | * Introduced a mechanism so that the failure message of custom extensions can specify the {context} tag. 72 | * NuGet package is now based on NuGet 2.0. 73 | 74 | Breaking changes 75 | * The FluentAssertions.Assertions namespace no longer exists so that all extension methods are always available through the FluentAssertions namespace. Just use a global search-replace to remove all those usage statements. 76 | * Many of the assertion classes have moved into dedicated namespaces. You might have to fix any code that inherits from those classes. 77 | * Remove the obsolete Verify() methods from the Verification class 78 | Copyright Dennis Doomen 2010-2012 79 | en-US 80 | MSTest xUnit NUnit MSpec Gallio MbUnit TDD BDD Fluent Silverlight 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/net35/FluentAssertions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/net35/FluentAssertions.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/net35/FluentAssertions.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/net35/FluentAssertions.pdb -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/net40/FluentAssertions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/net40/FluentAssertions.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/net40/FluentAssertions.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/net40/FluentAssertions.pdb -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/net45/FluentAssertions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/net45/FluentAssertions.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/net45/FluentAssertions.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/net45/FluentAssertions.pdb -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/sl4-windowsphone71/FluentAssertions.WindowsPhone.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/sl4-windowsphone71/FluentAssertions.WindowsPhone.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/sl4-windowsphone71/FluentAssertions.WindowsPhone.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/sl4-windowsphone71/FluentAssertions.WindowsPhone.pdb -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/sl4/FluentAssertions.Silverlight.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/sl4/FluentAssertions.Silverlight.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/sl4/FluentAssertions.Silverlight.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/sl4/FluentAssertions.Silverlight.pdb -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/sl4/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/sl4/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/sl4/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/sl4/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.pdb -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/winrt45/FluentAssertions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/winrt45/FluentAssertions.dll -------------------------------------------------------------------------------- /packages/FluentAssertions.2.0.1/lib/winrt45/FluentAssertions.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/FluentAssertions.2.0.1/lib/winrt45/FluentAssertions.pdb -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/JsonFx.2.0.1209.2802.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/JsonFx.2.0.1209.2802.nupkg -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/JsonFx.2.0.1209.2802.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JsonFx 5 | 2.0.1209.2802 6 | JsonFx 7 | Stephen McKamey 8 | Stephen McKamey 9 | https://raw.github.com/jsonfx/jsonfx/master/LICENSE.txt 10 | https://github.com/jsonfx/jsonfx 11 | https://raw.github.com/jsonfx/jsonfx/master/Logo_128.png 12 | true 13 | JsonFx serialization framework 14 | JSON XML BSON JsonML LINQ serialization deserialization 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/net20/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/net20/JsonFx.dll -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/net35/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/net35/JsonFx.dll -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/net40/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/net40/JsonFx.dll -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/sl35/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/sl35/JsonFx.dll -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/sl40-wp/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/sl40-wp/JsonFx.dll -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/sl40/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/sl40/JsonFx.dll -------------------------------------------------------------------------------- /packages/JsonFx.2.0.1209.2802/lib/wp40/JsonFx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/JsonFx.2.0.1209.2802/lib/wp40/JsonFx.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/Logo.ico -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/NUnitFitTests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

NUnit Acceptance Tests

5 |

6 | Developers love self-referential programs! Hence, NUnit has always run all it's 7 | own tests, even those that are not really unit tests. 8 |

Now, beginning with NUnit 2.4, NUnit has top-level tests using Ward Cunningham's 9 | FIT framework. At this time, the tests are pretty rudimentary, but it's a start 10 | and it's a framework for doing more. 11 |

Running the Tests

12 |

Open a console or shell window and navigate to the NUnit bin directory, which 13 | contains this file. To run the test under Microsoft .Net, enter the command 14 |

    runFile NUnitFitTests.html TestResults.html .
15 | To run it under Mono, enter 16 |
    mono runFile.exe NUnitFitTests.html TestResults.html .
17 | Note the space and dot at the end of each command. The results of your test 18 | will be in TestResults.html in the same directory. 19 |

Platform and CLR Version

20 | 21 | 22 | 23 | 24 |
NUnit.Fixtures.PlatformInfo
25 |

Verify Unit Tests

26 |

27 | Load and run the NUnit unit tests, verifying that the results are as expected. 28 | When these tests are run on different platforms, different numbers of tests may 29 | be skipped, so the values for Skipped and Run tests are informational only. 30 |

31 | The number of tests in each assembly should be constant across all platforms - 32 | any discrepancy usually means that one of the test source files was not 33 | compiled on the platform. There should be no failures and no tests ignored. 34 |

Note: 35 | At the moment, the nunit.extensions.tests assembly is failing because the 36 | fixture doesn't initialize addins in the test domain. 37 |

38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 |
NUnit.Fixtures.AssemblyRunner
AssemblyTests()Run()Skipped()Ignored()Failures()
nunit.framework.tests.dll397  00
nunit.core.tests.dll355  00
nunit.util.tests.dll238  00
nunit.mocks.tests.dll43  00
nunit.extensions.tests.dll5  00
nunit-console.tests.dll40  00
nunit.uikit.tests.dll34  00
nunit-gui.tests.dll15  00
nunit.fixtures.tests.dll6  00
123 |

Code Snippet Tests

124 |

125 | These tests create a test assembly from a snippet of code and then load and run 126 | the tests that it contains, verifying that the structure of the loaded tests is 127 | as expected and that the number of tests run, skipped, ignored or failed is 128 | correct. 129 |

130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 181 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 210 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 235 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 259 | 264 | 265 | 266 | 267 | 268 | 269 |
NUnit.Fixtures.SnippetRunner
CodeTree()Run()Skipped()Ignored()Failures()
public class TestClass
144 | {
145 | }
146 |
EMPTY0000
using NUnit.Framework;
155 | 
156 | [TestFixture]
157 | public class TestClass
158 | {
159 | }
160 |
TestClass0000
using NUnit.Framework;
169 | 
170 | [TestFixture]
171 | public class TestClass
172 | {
173 |     [Test]
174 |     public void T1() { }
175 |     [Test]
176 |     public void T2() { }
177 |     [Test]
178 |     public void T3() { }
179 | }
180 |
TestClass
182 | >T1
183 | >T2
184 | >T3
185 |
3000
using NUnit.Framework;
193 | 
194 | [TestFixture]
195 | public class TestClass1
196 | {
197 |     [Test]
198 |     public void T1() { }
199 | }
200 | 
201 | [TestFixture]
202 | public class TestClass2
203 | {
204 |     [Test]
205 |     public void T2() { }
206 |     [Test]
207 |     public void T3() { }
208 | }
209 |
TestClass1
211 | >T1
212 | TestClass2
213 | >T2
214 | >T3
215 |
3000
using NUnit.Framework;
223 | 
224 | [TestFixture]
225 | public class TestClass
226 | {
227 |     [Test]
228 |     public void T1() { }
229 |     [Test, Ignore]
230 |     public void T2() { }
231 |     [Test]
232 |     public void T3() { }
233 | }
234 |
TestClass
236 | >T1
237 | >T2
238 | >T3
239 |
2010
using NUnit.Framework;
247 | 
248 | [TestFixture]
249 | public class TestClass
250 | {
251 |     [Test]
252 |     public void T1() { }
253 |     [Test, Explicit]
254 |     public void T2() { }
255 |     [Test]
256 |     public void T3() { }
257 | }
258 |
TestClass
260 | >T1
261 | >T2
262 | >T3
263 |
2100
270 |

Summary Information

271 | 272 | 273 | 274 | 275 |
fit.Summary
276 | 277 | 278 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/license.txt -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/NUnitTests.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 25 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 54 | 55 | 60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/agent.conf: -------------------------------------------------------------------------------- 1 | 2 | 8080 3 | . 4 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/agent.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/launcher.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/Failure.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/Success.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/fit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/fit.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit-console.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/runFile.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.5.10.11092/tools/runFile.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/runFile.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/runpnunit.bat: -------------------------------------------------------------------------------- 1 | start pnunit-agent agent.conf 2 | pnunit-launcher test.conf -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/test.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Testing 6 | 7 | 8 | Testing 9 | pnunit.tests.dll 10 | TestLibraries.Testing.EqualTo19 11 | localhost:8080 12 | 13 | ..\server 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /packages/NUnit.2.6.2/NUnit.2.6.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.6.2/NUnit.2.6.2.nupkg -------------------------------------------------------------------------------- /packages/NUnit.2.6.2/NUnit.2.6.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NUnit 5 | 2.6.2 6 | NUnit 7 | Charlie Poole 8 | Charlie Poole 9 | http://nunit.org/nuget/license.html 10 | http://nunit.org/ 11 | http://nunit.org/nuget/nunit_32x32.png 12 | false 13 | NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests. 14 | 15 | Version 2.6 is the seventh major release of this well-known and well-tested programming tool. 16 | 17 | This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. 18 | NUnit is a unit-testing framework for all .Net languages with a strong TDD focus. 19 | Version 2.6 is the seventh major release of NUnit. 20 | 21 | Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. 22 | 23 | The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package. 24 | en-US 25 | test testing tdd framework fluent assert theory plugin addin 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /packages/NUnit.2.6.2/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.6.2/lib/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.6.2/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stack72/TeamCitySharp/66404df0ee9af37c5bd1cf43a2f96fe0e6e1364f/packages/NUnit.2.6.2/license.txt -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/Agents.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.Connection; 3 | using TeamCitySharp.DomainEntities; 4 | 5 | namespace TeamCitySharp.ActionTypes 6 | { 7 | internal class Agents : IAgents 8 | { 9 | private readonly TeamCityCaller _caller; 10 | 11 | internal Agents(TeamCityCaller caller) 12 | { 13 | _caller = caller; 14 | } 15 | 16 | public List All() 17 | { 18 | var agentWrapper = _caller.Get("/app/rest/agents"); 19 | 20 | return agentWrapper.Agent; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/BackupOptions.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.ActionTypes 2 | { 3 | public class BackupOptions 4 | { 5 | public string Filename { get; set; } 6 | 7 | public bool IncludeDatabase { get; set; } 8 | 9 | public bool IncludeConfigurations { get; set; } 10 | 11 | public bool IncludeBuildLogs { get; set; } 12 | 13 | public bool IncludePersonalChanges { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/BuildArtifacts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Xml; 7 | 8 | using TeamCitySharp.Connection; 9 | 10 | namespace TeamCitySharp.ActionTypes 11 | { 12 | internal class BuildArtifacts : IBuildArtifacts 13 | { 14 | private readonly TeamCityCaller _caller; 15 | 16 | public BuildArtifacts(TeamCityCaller caller) 17 | { 18 | _caller = caller; 19 | } 20 | 21 | public void DownloadArtifactsByBuildId(string buildId, Action downloadHandler) 22 | { 23 | _caller.GetDownloadFormat(downloadHandler, "/downloadArtifacts.html?buildId={0}", buildId); 24 | } 25 | 26 | public ArtifactWrapper ByBuildConfigId(string buildConfigId) 27 | { 28 | return new ArtifactWrapper(_caller, buildConfigId); 29 | } 30 | } 31 | 32 | public class ArtifactWrapper 33 | { 34 | private readonly TeamCityCaller _caller; 35 | private readonly string _buildConfigId; 36 | 37 | internal ArtifactWrapper(TeamCityCaller caller, string buildConfigId) 38 | { 39 | _caller = caller; 40 | _buildConfigId = buildConfigId; 41 | } 42 | 43 | public ArtifactCollection LastFinished() 44 | { 45 | return Specification(".lastFinished"); 46 | } 47 | 48 | public ArtifactCollection LastPinned() 49 | { 50 | return Specification(".lastPinned"); 51 | } 52 | 53 | public ArtifactCollection LastSuccessful() 54 | { 55 | return Specification(".lastSuccessful"); 56 | } 57 | 58 | public ArtifactCollection Tag(string tag) 59 | { 60 | return Specification(tag + ".tcbuildtag"); 61 | } 62 | 63 | public ArtifactCollection Specification(string buildSpecification) 64 | { 65 | var xml = _caller.GetRaw(string.Format("/repository/download/{0}/{1}/teamcity-ivy.xml", _buildConfigId, buildSpecification)); 66 | 67 | var document = new XmlDocument(); 68 | document.LoadXml(xml); 69 | var artifactNodes = document.SelectNodes("//artifact"); 70 | if (artifactNodes == null) 71 | { 72 | return null; 73 | } 74 | var list = new List(); 75 | foreach (XmlNode node in artifactNodes) 76 | { 77 | var nameNode = node.SelectSingleNode("@name"); 78 | var extensionNode = node.SelectSingleNode("@ext"); 79 | var artifact = string.Empty; 80 | if (nameNode != null) 81 | { 82 | artifact = nameNode.Value; 83 | } 84 | if (extensionNode != null) 85 | { 86 | artifact += "." + extensionNode.Value; 87 | } 88 | list.Add(string.Format("/repository/download/{0}/{1}/{2}", _buildConfigId, buildSpecification, artifact)); 89 | } 90 | return new ArtifactCollection(_caller, list); 91 | } 92 | } 93 | 94 | public class ArtifactCollection 95 | { 96 | private readonly TeamCityCaller _caller; 97 | private readonly List _urls; 98 | 99 | internal ArtifactCollection(TeamCityCaller caller, List urls) 100 | { 101 | _caller = caller; 102 | _urls = urls; 103 | } 104 | 105 | /// 106 | /// Takes a list of artifact urls and downloads them, see ArtifactsBy* methods. 107 | /// 108 | /// 109 | /// Destination directory for downloaded artifacts, default is current working directory. 110 | /// 111 | /// 112 | /// If all files will be downloaded to destination directory, no subfolders will be created. 113 | /// 114 | /// 115 | /// If files that already exist where a downloaded file is to be placed will be deleted prior to download. 116 | /// 117 | /// 118 | /// A list of full paths to all downloaded artifacts. 119 | /// 120 | public List Download(string directory = null, bool flatten = false, bool overwrite = true) 121 | { 122 | if (directory == null) 123 | { 124 | directory = Directory.GetCurrentDirectory(); 125 | } 126 | var downloaded = new List(); 127 | foreach (var url in _urls) 128 | { 129 | // user probably didnt use to artifact url generating functions 130 | Debug.Assert(url.StartsWith("/repository/download/")); 131 | 132 | // figure out local filename 133 | var parts = url.Split('/').Skip(5).ToArray(); 134 | var destination = flatten 135 | ? parts.Last() 136 | : string.Join(Path.DirectorySeparatorChar.ToString(), parts); 137 | destination = Path.Combine(directory, destination); 138 | 139 | // create directories that doesnt exist 140 | var directoryName = Path.GetDirectoryName(destination); 141 | if (directoryName != null && !Directory.Exists(directoryName)) 142 | { 143 | Directory.CreateDirectory(directoryName); 144 | } 145 | 146 | // add artifact to list regardless if it was downloaded or skipped 147 | downloaded.Add(Path.GetFullPath(destination)); 148 | 149 | // if the file already exists delete it or move to next artifact 150 | if (File.Exists(destination)) 151 | { 152 | if (overwrite) File.Delete(destination); 153 | else continue; 154 | } 155 | _caller.GetDownloadFormat(tempfile => File.Move(tempfile, destination), url); 156 | } 157 | return downloaded; 158 | } 159 | } 160 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/BuildConfigs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Net.Mime; 5 | using System.Xml; 6 | using EasyHttp.Http; 7 | using TeamCitySharp.Connection; 8 | using TeamCitySharp.DomainEntities; 9 | using TeamCitySharp.Locators; 10 | 11 | namespace TeamCitySharp.ActionTypes 12 | { 13 | internal class BuildConfigs : IBuildConfigs 14 | { 15 | private readonly TeamCityCaller _caller; 16 | 17 | internal BuildConfigs(TeamCityCaller caller) 18 | { 19 | _caller = caller; 20 | } 21 | 22 | public List All() 23 | { 24 | var buildType = _caller.Get("/app/rest/buildTypes"); 25 | 26 | return buildType.BuildType; 27 | } 28 | 29 | public BuildConfig ByConfigurationName(string buildConfigName) 30 | { 31 | var build = _caller.GetFormat("/app/rest/buildTypes/name:{0}", buildConfigName); 32 | 33 | return build; 34 | } 35 | 36 | public BuildConfig ByConfigurationId(string buildConfigId) 37 | { 38 | var build = _caller.GetFormat("/app/rest/buildTypes/id:{0}", buildConfigId); 39 | 40 | return build; 41 | } 42 | 43 | public BuildConfig ByProjectNameAndConfigurationName(string projectName, string buildConfigName) 44 | { 45 | var build = _caller.Get(string.Format("/app/rest/projects/name:{0}/buildTypes/name:{1}", projectName, buildConfigName)); 46 | return build; 47 | } 48 | 49 | public BuildConfig ByProjectNameAndConfigurationId(string projectName, string buildConfigId) 50 | { 51 | var build = _caller.Get(string.Format("/app/rest/projects/name:{0}/buildTypes/id:{1}", projectName, buildConfigId)); 52 | return build; 53 | } 54 | 55 | public BuildConfig ByProjectIdAndConfigurationName(string projectId, string buildConfigName) 56 | { 57 | var build = _caller.Get(string.Format("/app/rest/projects/id:{0}/buildTypes/name:{1}", projectId, buildConfigName)); 58 | return build; 59 | } 60 | 61 | public BuildConfig ByProjectIdAndConfigurationId(string projectId, string buildConfigId) 62 | { 63 | var build = _caller.Get(string.Format("/app/rest/projects/id:{0}/buildTypes/id:{1}", projectId, buildConfigId)); 64 | return build; 65 | } 66 | 67 | public List ByProjectId(string projectId) 68 | { 69 | var buildWrapper = _caller.GetFormat("/app/rest/projects/id:{0}/buildTypes", projectId); 70 | 71 | if (buildWrapper == null || buildWrapper.BuildType == null) return new List(); 72 | return buildWrapper.BuildType; 73 | } 74 | 75 | public List ByProjectName(string projectName) 76 | { 77 | var buildWrapper = _caller.GetFormat("/app/rest/projects/name:{0}/buildTypes", projectName); 78 | 79 | if (buildWrapper == null || buildWrapper.BuildType == null) return new List(); 80 | return buildWrapper.BuildType; 81 | } 82 | 83 | public BuildConfig CreateConfiguration(string projectName, string configurationName) 84 | { 85 | return _caller.PostFormat(configurationName, HttpContentTypes.TextPlain, HttpContentTypes.ApplicationJson, "/app/rest/projects/name:{0}/buildTypes", projectName); 86 | } 87 | 88 | public void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue) 89 | { 90 | _caller.PutFormat(settingValue, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/settings/{1}", locator, settingName); 91 | } 92 | 93 | public bool GetConfigurationPauseStatus(BuildTypeLocator locator) 94 | { 95 | return _caller.Get(string.Format("/app/rest/buildTypes/{0}/paused/", locator.Name)); 96 | } 97 | public void SetConfigurationPauseStatus(BuildTypeLocator locator, bool isPaused) 98 | { 99 | _caller.PutFormat(isPaused, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/paused/", locator); 100 | } 101 | 102 | public void PostRawArtifactDependency(BuildTypeLocator locator, string rawXml) 103 | { 104 | _caller.PostFormat(rawXml, HttpContentTypes.ApplicationXml, string.Empty, "/app/rest/buildTypes/{0}/artifact-dependencies", locator); 105 | } 106 | 107 | public void PostRawBuildStep(BuildTypeLocator locator, string rawXml) 108 | { 109 | _caller.PostFormat(rawXml, HttpContentTypes.ApplicationXml, string.Empty, "/app/rest/buildTypes/{0}/steps", locator); 110 | } 111 | 112 | public void PostRawBuildTrigger(BuildTypeLocator locator, string rawXml) 113 | { 114 | _caller.PostFormat(rawXml, HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/triggers", locator); 115 | } 116 | 117 | public void SetConfigurationParameter(BuildTypeLocator locator, string key, string value) 118 | { 119 | _caller.PutFormat(value, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/parameters/{1}", locator, key); 120 | } 121 | 122 | public void DeleteConfiguration(BuildTypeLocator locator) 123 | { 124 | _caller.DeleteFormat("/app/rest/buildTypes/{0}", locator); 125 | } 126 | 127 | public void DeleteAllBuildTypeParameters(BuildTypeLocator locator) 128 | { 129 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/parameters", locator); 130 | } 131 | 132 | public void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary parameters) 133 | { 134 | if(locator == null) 135 | throw new ArgumentNullException("locator"); 136 | if(parameters == null) 137 | throw new ArgumentNullException("parameters"); 138 | 139 | StringWriter sw = new StringWriter(); 140 | using(XmlTextWriter writer = new XmlTextWriter(sw)) 141 | { 142 | writer.WriteStartElement("properties"); 143 | foreach(var parameter in parameters) 144 | { 145 | writer.WriteStartElement("property"); 146 | writer.WriteAttributeString("name", parameter.Key); 147 | writer.WriteAttributeString("value", parameter.Value); 148 | writer.WriteEndElement(); 149 | } 150 | writer.WriteEndElement(); 151 | } 152 | 153 | _caller.PutFormat(sw.ToString(), HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/parameters", locator); 154 | } 155 | 156 | public void DownloadConfiguration(BuildTypeLocator locator, Action downloadHandler) 157 | { 158 | _caller.GetDownloadFormat(downloadHandler, "/app/rest/buildTypes/{0}", locator); 159 | } 160 | 161 | public void PostRawAgentRequirement(BuildTypeLocator locator, string rawXml) 162 | { 163 | _caller.PostFormat(rawXml, HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/agent-requirements", locator); 164 | } 165 | 166 | public void DeleteBuildStep(BuildTypeLocator locator, string buildStepId) 167 | { 168 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/steps/{1}", locator, buildStepId); 169 | } 170 | 171 | public void DeleteArtifactDependency(BuildTypeLocator locator, string artifactDependencyId) 172 | { 173 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/artifact-dependencies/{1}", locator, artifactDependencyId); 174 | } 175 | 176 | public void DeleteAgentRequirement(BuildTypeLocator locator, string agentRequirementId) 177 | { 178 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/agent-requirements/{1}", locator, agentRequirementId); 179 | } 180 | 181 | public void DeleteParameter(BuildTypeLocator locator, string parameterName) 182 | { 183 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/parameters/{1}", locator, parameterName); 184 | } 185 | 186 | public void DeleteBuildTrigger(BuildTypeLocator locator, string buildTriggerId) 187 | { 188 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/triggers/{1}", locator, buildTriggerId); 189 | } 190 | 191 | public void SetBuildTypeTemplate(BuildTypeLocator locatorBuildType, BuildTypeLocator locatorTemplate) 192 | { 193 | _caller.PutFormat(locatorTemplate.ToString(), HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/template", locatorBuildType); 194 | } 195 | 196 | public void DeleteSnapshotDependency(BuildTypeLocator locator, string snapshotDependencyId) 197 | { 198 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/snapshot-dependencies/{1}", locator, snapshotDependencyId); 199 | } 200 | 201 | public void PostRawSnapshotDependency(BuildTypeLocator locator, XmlElement rawXml) 202 | { 203 | _caller.PostFormat(rawXml.OuterXml, HttpContentTypes.ApplicationXml, "/app/rest/buildTypes/{0}/snapshot-dependencies", locator); 204 | } 205 | 206 | public BuildConfig BuildType(BuildTypeLocator locator) 207 | { 208 | var build = _caller.GetFormat("/app/rest/buildTypes/{0}", locator); 209 | 210 | return build; 211 | } 212 | } 213 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/Builds.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using TeamCitySharp.Connection; 5 | using TeamCitySharp.DomainEntities; 6 | using TeamCitySharp.Locators; 7 | 8 | namespace TeamCitySharp.ActionTypes 9 | { 10 | internal class Builds : IBuilds 11 | { 12 | private readonly TeamCityCaller _caller; 13 | 14 | internal Builds(TeamCityCaller caller) 15 | { 16 | _caller = caller; 17 | } 18 | 19 | public List ByBuildLocator(BuildLocator locator) 20 | { 21 | var buildWrapper = _caller.GetFormat("/app/rest/builds?locator={0}", locator); 22 | if (int.Parse(buildWrapper.Count) > 0) 23 | { 24 | return buildWrapper.Build; 25 | } 26 | return new List(); 27 | } 28 | 29 | public Build LastBuildByAgent(string agentName) 30 | { 31 | return ByBuildLocator(BuildLocator.WithDimensions( 32 | agentName: agentName, 33 | maxResults: 1 34 | )).SingleOrDefault(); 35 | } 36 | 37 | public void Add2QueueBuildByBuildConfigId(string buildConfigId) 38 | { 39 | _caller.GetFormat("/action.html?add2Queue={0}", buildConfigId); 40 | } 41 | 42 | public List SuccessfulBuildsByBuildConfigId(string buildConfigId) 43 | { 44 | return ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 45 | status: BuildStatus.SUCCESS 46 | )); 47 | } 48 | 49 | public Build LastSuccessfulBuildByBuildConfigId(string buildConfigId) 50 | { 51 | var builds = ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 52 | status: BuildStatus.SUCCESS, 53 | maxResults: 1 54 | )); 55 | return builds != null ? builds.FirstOrDefault() : new Build(); 56 | } 57 | 58 | public List FailedBuildsByBuildConfigId(string buildConfigId) 59 | { 60 | return ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 61 | status: BuildStatus.FAILURE 62 | )); 63 | } 64 | 65 | public Build LastFailedBuildByBuildConfigId(string buildConfigId) 66 | { 67 | var builds = ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 68 | status: BuildStatus.FAILURE, 69 | maxResults: 1 70 | )); 71 | return builds != null ? builds.FirstOrDefault() : new Build(); 72 | } 73 | 74 | public Build LastBuildByBuildConfigId(string buildConfigId) 75 | { 76 | var builds = ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 77 | maxResults: 1 78 | )); 79 | return builds != null ? builds.FirstOrDefault() : new Build(); 80 | } 81 | 82 | public List ErrorBuildsByBuildConfigId(string buildConfigId) 83 | { 84 | return ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 85 | status: BuildStatus.ERROR 86 | )); 87 | } 88 | 89 | public Build LastErrorBuildByBuildConfigId(string buildConfigId) 90 | { 91 | var builds = ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 92 | status: BuildStatus.ERROR, 93 | maxResults: 1 94 | )); 95 | return builds != null ? builds.FirstOrDefault() : new Build(); 96 | } 97 | 98 | public List ByBuildConfigId(string buildConfigId) 99 | { 100 | return ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId) 101 | )); 102 | } 103 | 104 | public List ByConfigIdAndTag(string buildConfigId, string tag) 105 | { 106 | return ByConfigIdAndTag(buildConfigId, new[] { tag }); 107 | } 108 | 109 | public List ByConfigIdAndTag(string buildConfigId, string[] tags) 110 | { 111 | return ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 112 | tags: tags 113 | )); 114 | } 115 | 116 | public List ByUserName(string userName) 117 | { 118 | return ByBuildLocator(BuildLocator.WithDimensions( 119 | user: UserLocator.WithUserName(userName) 120 | )); 121 | } 122 | 123 | public List AllSinceDate(DateTime date) 124 | { 125 | return ByBuildLocator(BuildLocator.WithDimensions(sinceDate: date)); 126 | } 127 | 128 | public List ByBranch(string branchName) 129 | { 130 | return ByBuildLocator(BuildLocator.WithDimensions(branch: branchName)); 131 | } 132 | 133 | public List AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus) 134 | { 135 | return ByBuildLocator(BuildLocator.WithDimensions(sinceDate: date, status: buildStatus)); 136 | } 137 | 138 | public List NonSuccessfulBuildsForUser(string userName) 139 | { 140 | var builds = ByUserName(userName); 141 | if (builds == null) 142 | { 143 | return null; 144 | } 145 | 146 | return builds.Where(b => b.Status != "SUCCESS").ToList(); 147 | } 148 | } 149 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/Changes.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using TeamCitySharp.Connection; 4 | using TeamCitySharp.DomainEntities; 5 | 6 | namespace TeamCitySharp.ActionTypes 7 | { 8 | internal class Changes : IChanges 9 | { 10 | private readonly TeamCityCaller _caller; 11 | 12 | internal Changes(TeamCityCaller caller) 13 | { 14 | _caller = caller; 15 | } 16 | 17 | public List All() 18 | { 19 | var changeWrapper = _caller.Get("/app/rest/changes"); 20 | 21 | return changeWrapper.Change; 22 | } 23 | 24 | public Change ByChangeId(string id) 25 | { 26 | var change = _caller.GetFormat("/app/rest/changes/id:{0}", id); 27 | 28 | return change; 29 | } 30 | 31 | public List ByBuildConfigId(string buildConfigId) 32 | { 33 | var changeWrapper = _caller.GetFormat("/app/rest/changes?buildType={0}", buildConfigId); 34 | 35 | return changeWrapper.Change; 36 | } 37 | 38 | public Change LastChangeDetailByBuildConfigId(string buildConfigId) 39 | { 40 | var changes = ByBuildConfigId(buildConfigId); 41 | 42 | return changes.FirstOrDefault(); 43 | } 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IAgents.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.DomainEntities; 3 | 4 | namespace TeamCitySharp.ActionTypes 5 | { 6 | public interface IAgents 7 | { 8 | List All(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IBuildArtifacts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeamCitySharp.ActionTypes 4 | { 5 | public interface IBuildArtifacts 6 | { 7 | void DownloadArtifactsByBuildId(string buildId, Action downloadHandler); 8 | 9 | ArtifactWrapper ByBuildConfigId(string buildConfigId); 10 | } 11 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IBuildConfigs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml; 4 | using TeamCitySharp.DomainEntities; 5 | using TeamCitySharp.Locators; 6 | 7 | namespace TeamCitySharp.ActionTypes 8 | { 9 | public interface IBuildConfigs 10 | { 11 | List All(); 12 | BuildConfig ByConfigurationName(string buildConfigName); 13 | BuildConfig ByConfigurationId(string buildConfigId); 14 | BuildConfig ByProjectNameAndConfigurationName(string projectName, string buildConfigName); 15 | BuildConfig ByProjectNameAndConfigurationId(string projectName, string buildConfigId); 16 | BuildConfig ByProjectIdAndConfigurationName(string projectId, string buildConfigName); 17 | BuildConfig ByProjectIdAndConfigurationId(string projectId, string buildConfigId); 18 | List ByProjectId(string projectId); 19 | List ByProjectName(string projectName); 20 | BuildConfig CreateConfiguration(string projectName, string configurationName); 21 | 22 | void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue); 23 | bool GetConfigurationPauseStatus(BuildTypeLocator locator); 24 | void SetConfigurationPauseStatus(BuildTypeLocator locator, bool isPaused); 25 | void PostRawArtifactDependency(BuildTypeLocator locator, string rawXml); 26 | void PostRawBuildStep(BuildTypeLocator locator, string rawXml); 27 | void PostRawBuildTrigger(BuildTypeLocator locator, string rawXml); 28 | void SetConfigurationParameter(BuildTypeLocator locator, string key, string value); 29 | void PostRawAgentRequirement(BuildTypeLocator locator, string rawXml); 30 | void DeleteBuildStep(BuildTypeLocator locator, string buildStepId); 31 | void DeleteArtifactDependency(BuildTypeLocator locator, string artifactDependencyId); 32 | void DeleteAgentRequirement(BuildTypeLocator locator, string agentRequirementId); 33 | void DeleteParameter(BuildTypeLocator locator, string parameterName); 34 | void DeleteBuildTrigger(BuildTypeLocator locator, string buildTriggerId); 35 | 36 | /// 37 | /// Makes a build type inherit a template. 38 | /// 39 | /// Locator for the build type which is to be associated with a template. 40 | /// Locator for the template. 41 | void SetBuildTypeTemplate(BuildTypeLocator locatorBuildType, BuildTypeLocator locatorTemplate); 42 | 43 | /// 44 | /// Deletes a snapshot dependency from a build type. 45 | /// 46 | /// Locator for the build type. 47 | /// The field value of the dependency to be removed. 48 | void DeleteSnapshotDependency(BuildTypeLocator locator, string snapshotDependencyId); 49 | 50 | /// 51 | /// Adds a snapshot dependency to a build type. Have to post raw XML data which looks like this: 52 | /// 54 | /// 55 | /// 56 | /// 57 | /// 58 | /// 59 | /// 60 | /// 61 | /// 62 | /// ]]> 63 | /// 64 | void PostRawSnapshotDependency(BuildTypeLocator locator, XmlElement rawXml); 65 | 66 | /// 67 | /// Locates a build type by its locator. 68 | /// Essentially, it works either like or , whichever is defined in the locator. 69 | /// 70 | /// Locator for the build type. 71 | /// The build type with all its properties. 72 | BuildConfig BuildType(BuildTypeLocator locator); 73 | 74 | void DeleteConfiguration(BuildTypeLocator locator); 75 | 76 | /// 77 | /// Deletes all of the parameters defined locally on this build type. 78 | /// This spares those parameters inherited from the template, you will still get them when listing all parameters. 79 | /// 80 | /// 8.0 81 | void DeleteAllBuildTypeParameters(BuildTypeLocator locator); 82 | 83 | /// 84 | /// Replaces all of the parameters defined locally on this build type with the new set supplied. 85 | /// Same as calling and then for each entry. 86 | /// 87 | /// 8.0 88 | void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary parameters); 89 | 90 | void DownloadConfiguration(BuildTypeLocator locator, Action downloadHandler); 91 | } 92 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IBuilds.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using TeamCitySharp.DomainEntities; 4 | using TeamCitySharp.Locators; 5 | 6 | namespace TeamCitySharp.ActionTypes 7 | { 8 | public interface IBuilds 9 | { 10 | List SuccessfulBuildsByBuildConfigId(string buildConfigId); 11 | Build LastSuccessfulBuildByBuildConfigId(string buildConfigId); 12 | List FailedBuildsByBuildConfigId(string buildConfigId); 13 | Build LastFailedBuildByBuildConfigId(string buildConfigId); 14 | Build LastBuildByBuildConfigId(string buildConfigId); 15 | List ErrorBuildsByBuildConfigId(string buildConfigId); 16 | Build LastErrorBuildByBuildConfigId(string buildConfigId); 17 | List ByBuildConfigId(string buildConfigId); 18 | List ByConfigIdAndTag(string buildConfigId, string tag); 19 | List ByUserName(string userName); 20 | List ByBuildLocator(BuildLocator locator); 21 | List AllSinceDate(DateTime date); 22 | List AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus); 23 | List NonSuccessfulBuildsForUser(string userName); 24 | List ByBranch(string branchName); 25 | Build LastBuildByAgent(string agentName); 26 | void Add2QueueBuildByBuildConfigId(string buildConfigId); 27 | } 28 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IChanges.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.DomainEntities; 3 | 4 | namespace TeamCitySharp.ActionTypes 5 | { 6 | public interface IChanges 7 | { 8 | List All(); 9 | Change ByChangeId(string id); 10 | Change LastChangeDetailByBuildConfigId(string buildConfigId); 11 | List ByBuildConfigId(string buildConfigId); 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IProjects.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.DomainEntities; 3 | 4 | namespace TeamCitySharp.ActionTypes 5 | { 6 | public interface IProjects 7 | { 8 | List All(); 9 | Project ByName(string projectLocatorName); 10 | Project ById(string projectLocatorId); 11 | Project Details(Project project); 12 | Project Create(string projectName); 13 | void Delete(string projectName); 14 | void DeleteProjectParameter(string projectName, string parameterName); 15 | void SetProjectParameter(string projectName, string settingName, string settingValue); 16 | } 17 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IServerInformation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.DomainEntities; 3 | 4 | namespace TeamCitySharp.ActionTypes 5 | { 6 | public interface IServerInformation 7 | { 8 | Server ServerInfo(); 9 | List AllPlugins(); 10 | string TriggerServerInstanceBackup(BackupOptions backupOptions); 11 | string GetBackupStatus(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IUsers.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.DomainEntities; 3 | 4 | namespace TeamCitySharp.ActionTypes 5 | { 6 | public interface IUsers 7 | { 8 | List All(); 9 | User Details(string userName); 10 | List AllRolesByUserName(string userName); 11 | List AllGroupsByUserName(string userName); 12 | List AllUserGroups(); 13 | List AllUsersByUserGroup(string userGroupName); 14 | List AllUserRolesByUserGroup(string userGroupName); 15 | bool Create(string username, string name, string email, string password); 16 | bool AddPassword(string username, string password); 17 | } 18 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/IVcsRoots.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TeamCitySharp.DomainEntities; 3 | using TeamCitySharp.Locators; 4 | 5 | namespace TeamCitySharp.ActionTypes 6 | { 7 | public interface IVcsRoots 8 | { 9 | List All(); 10 | VcsRoot ById(string vcsRootId); 11 | VcsRoot AttachVcsRoot(BuildTypeLocator locator, VcsRoot vcsRoot); 12 | void DetachVcsRoot(BuildTypeLocator locator, string vcsRootId); 13 | void SetVcsRootField(VcsRoot vcsRoot, VcsRootField field, object value); 14 | } 15 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/Projects.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EasyHttp.Http; 3 | using TeamCitySharp.Connection; 4 | using TeamCitySharp.DomainEntities; 5 | 6 | namespace TeamCitySharp.ActionTypes 7 | { 8 | internal class Projects : IProjects 9 | { 10 | private readonly TeamCityCaller _caller; 11 | 12 | internal Projects(TeamCityCaller caller) 13 | { 14 | _caller = caller; 15 | } 16 | 17 | public List All() 18 | { 19 | var projectWrapper = _caller.Get("/app/rest/projects"); 20 | 21 | return projectWrapper.Project; 22 | } 23 | 24 | public Project ByName(string projectLocatorName) 25 | { 26 | var project = _caller.GetFormat("/app/rest/projects/name:{0}", projectLocatorName); 27 | 28 | return project; 29 | } 30 | 31 | public Project ById(string projectLocatorId) 32 | { 33 | var project = _caller.GetFormat("/app/rest/projects/id:{0}", projectLocatorId); 34 | 35 | return project; 36 | } 37 | 38 | public Project Details(Project project) 39 | { 40 | return ById(project.Id); 41 | } 42 | 43 | public Project Create(string projectName) 44 | { 45 | return _caller.Post(projectName, HttpContentTypes.TextPlain, "/app/rest/projects/", HttpContentTypes.ApplicationJson); 46 | } 47 | 48 | public void Delete(string projectName) 49 | { 50 | _caller.DeleteFormat("/app/rest/projects/name:{0}", projectName); 51 | } 52 | 53 | public void DeleteProjectParameter(string projectName, string parameterName) 54 | { 55 | _caller.DeleteFormat("/app/rest/projects/name:{0}/parameters/{1}", projectName, parameterName); 56 | } 57 | 58 | public void SetProjectParameter(string projectName, string settingName, string settingValue) 59 | { 60 | _caller.PutFormat(settingValue, "/app/rest/projects/name:{0}/parameters/{1}", projectName, settingName); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/ServerInformation.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.ActionTypes 2 | { 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using TeamCitySharp.Connection; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | internal class ServerInformation : IServerInformation 9 | { 10 | private const string ServerUrlPrefix = "/app/rest/server"; 11 | private readonly ITeamCityCaller _caller; 12 | 13 | internal ServerInformation(ITeamCityCaller caller) 14 | { 15 | _caller = caller; 16 | } 17 | 18 | public Server ServerInfo() 19 | { 20 | var server = _caller.Get(ServerUrlPrefix); 21 | return server; 22 | } 23 | 24 | public List AllPlugins() 25 | { 26 | var pluginWrapper = _caller.Get(ServerUrlPrefix + "/plugins"); 27 | 28 | return pluginWrapper.Plugin; 29 | } 30 | 31 | public string TriggerServerInstanceBackup(BackupOptions backupOptions) 32 | { 33 | var backupOptionsUrlPart = this.BuildBackupOptionsUrl(backupOptions); 34 | var url = string.Concat(ServerUrlPrefix, "/backup?", backupOptionsUrlPart); 35 | 36 | return _caller.StartBackup(url); 37 | } 38 | 39 | public string GetBackupStatus() 40 | { 41 | var url = string.Concat(ServerUrlPrefix, "/backup"); 42 | 43 | return _caller.GetRaw(url); 44 | } 45 | 46 | private string BuildBackupOptionsUrl(BackupOptions backupOptions) 47 | { 48 | return new StringBuilder() 49 | .Append("fileName=").Append(backupOptions.Filename) 50 | .Append("&includeBuildLogs=").Append(backupOptions.IncludeBuildLogs) 51 | .Append("&includeConfigs=").Append(backupOptions.IncludeConfigurations) 52 | .Append("&includeDatabase=").Append(backupOptions.IncludeDatabase) 53 | .Append("&includePersonalChanges=").Append(backupOptions.IncludePersonalChanges) 54 | .ToString(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/Users.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Net; 3 | using EasyHttp.Http; 4 | using TeamCitySharp.Connection; 5 | using TeamCitySharp.DomainEntities; 6 | 7 | namespace TeamCitySharp.ActionTypes 8 | { 9 | internal class Users : IUsers 10 | { 11 | private readonly TeamCityCaller _caller; 12 | 13 | internal Users(TeamCityCaller caller) 14 | { 15 | _caller = caller; 16 | } 17 | 18 | public List All() 19 | { 20 | var userWrapper = _caller.Get("/app/rest/users"); 21 | 22 | return userWrapper.User; 23 | } 24 | 25 | public List AllRolesByUserName(string userName) 26 | { 27 | var user = 28 | _caller.GetFormat("/app/rest/users/username:{0}", userName); 29 | 30 | return user.Roles.Role; 31 | } 32 | 33 | public User Details(string userName) 34 | { 35 | var user = _caller.GetFormat("/app/rest/users/username:{0}", userName); 36 | 37 | return user; 38 | } 39 | 40 | public List AllGroupsByUserName(string userName) 41 | { 42 | var user = 43 | _caller.GetFormat("/app/rest/users/username:{0}", userName); 44 | 45 | return user.Groups.Group; 46 | } 47 | 48 | public List AllUserGroups() 49 | { 50 | var userGroupWrapper = _caller.Get("/app/rest/userGroups"); 51 | 52 | return userGroupWrapper.Group; 53 | } 54 | 55 | public List AllUsersByUserGroup(string userGroupName) 56 | { 57 | var group = _caller.GetFormat("/app/rest/userGroups/key:{0}", userGroupName); 58 | 59 | return group.Users.User; 60 | } 61 | 62 | public List AllUserRolesByUserGroup(string userGroupName) 63 | { 64 | var group = _caller.GetFormat("/app/rest/userGroups/key:{0}", userGroupName); 65 | 66 | return group.Roles.Role; 67 | } 68 | 69 | public bool Create(string username, string name, string email, string password) 70 | { 71 | bool result = false; 72 | 73 | string data = string.Format("", name, username, email, password); 74 | 75 | var createUserResponse = _caller.Post(data, HttpContentTypes.ApplicationXml, "/app/rest/users", string.Empty); 76 | 77 | // Workaround, Create POST request fails to deserialize password field. See http://youtrack.jetbrains.com/issue/TW-23200 78 | // Also this does not return an accurate representation of whether it has worked or not 79 | AddPassword(username, password); 80 | 81 | if (createUserResponse.StatusCode == HttpStatusCode.OK) 82 | { 83 | result = true; 84 | } 85 | 86 | return result; 87 | } 88 | 89 | public bool AddPassword(string username, string password) 90 | { 91 | bool result = false; 92 | 93 | var response = _caller.Put(password, HttpContentTypes.TextPlain, string.Format("/app/rest/users/username:{0}/password", username), string.Empty); 94 | 95 | if (response.StatusCode == HttpStatusCode.OK) 96 | { 97 | result = true; 98 | } 99 | 100 | return result; 101 | } 102 | 103 | } 104 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ActionTypes/VcsRoots.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EasyHttp.Http; 4 | using TeamCitySharp.Connection; 5 | using TeamCitySharp.DomainEntities; 6 | using TeamCitySharp.Locators; 7 | 8 | namespace TeamCitySharp.ActionTypes 9 | { 10 | internal class VcsRoots: IVcsRoots 11 | { 12 | private readonly TeamCityCaller _caller; 13 | 14 | internal VcsRoots(TeamCityCaller caller) 15 | { 16 | _caller = caller; 17 | } 18 | 19 | public List All() 20 | { 21 | var vcsRootWrapper = _caller.Get("/app/rest/vcs-roots"); 22 | 23 | return vcsRootWrapper.VcsRoot; 24 | } 25 | 26 | public VcsRoot ById(string vcsRootId) 27 | { 28 | var vcsRoot = _caller.GetFormat("/app/rest/vcs-roots/id:{0}", vcsRootId); 29 | 30 | return vcsRoot; 31 | } 32 | 33 | public VcsRoot AttachVcsRoot(BuildTypeLocator locator, VcsRoot vcsRoot) 34 | { 35 | var xml = string.Format(@"", vcsRoot.Id); 36 | return _caller.PostFormat(xml, HttpContentTypes.ApplicationXml, string.Empty, "/app/rest/buildTypes/{0}/vcs-root-entries", locator); 37 | } 38 | 39 | public void DetachVcsRoot(BuildTypeLocator locator, string vcsRootId) 40 | { 41 | _caller.DeleteFormat("/app/rest/buildTypes/{0}/vcs-root-entries/{1}", locator, vcsRootId); 42 | } 43 | 44 | public void SetVcsRootField(VcsRoot vcsRoot, VcsRootField field, object value) 45 | { 46 | _caller.PutFormat(value, "/app/rest/vcs-roots/id:{0}/{1}", vcsRoot.Id, ToCamelCase(field.ToString())); 47 | } 48 | 49 | private static string ToCamelCase(string s) 50 | { 51 | return Char.ToLower(s.ToCharArray()[0]) + s.Substring(1); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/TeamCitySharp/Connection/IClientConnection.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.Connection 2 | { 3 | internal interface IClientConnection 4 | { 5 | void Connect(string userName, string password); 6 | void ConnectAsGuest(); 7 | } 8 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/Connection/ITeamCityCaller.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.Connection 2 | { 3 | using System; 4 | using EasyHttp.Http; 5 | 6 | internal interface ITeamCityCaller 7 | { 8 | void Connect(string userName, string password, bool actAsGuest); 9 | 10 | T GetFormat(string urlPart, params object[] parts); 11 | 12 | void GetFormat(string urlPart, params object[] parts); 13 | 14 | T PostFormat(object data, string contenttype, string accept, string urlPart, params object[] parts); 15 | 16 | void PostFormat(object data, string contenttype, string urlPart, params object[] parts); 17 | 18 | void PutFormat(object data, string contenttype, string urlPart, params object[] parts); 19 | 20 | void DeleteFormat(string urlPart, params object[] parts); 21 | 22 | void GetDownloadFormat(Action downloadHandler, string urlPart, params object[] parts); 23 | 24 | string StartBackup(string urlPart); 25 | 26 | T Get(string urlPart); 27 | 28 | void Get(string urlPart); 29 | 30 | T Post(string data, string contenttype, string urlPart, string accept); 31 | 32 | bool Authenticate(string urlPart); 33 | 34 | HttpResponse Post(object data, string contenttype, string urlPart, string accept); 35 | 36 | HttpResponse Put(object data, string contenttype, string urlPart, string accept); 37 | 38 | void Delete(string urlPart); 39 | 40 | string GetRaw(string urlPart); 41 | } 42 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/Connection/TeamCityDateFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using JsonFx.IO; 5 | using JsonFx.Model; 6 | using JsonFx.Model.Filters; 7 | using JsonFx.Serialization; 8 | 9 | namespace TeamCitySharp.Connection 10 | { 11 | public class TeamCityDateFilter : ModelFilter 12 | { 13 | private const string DateFormat = "yyyyMMddTHHmmsszz00"; 14 | 15 | public override bool TryRead(DataReaderSettings settings, IStream> tokens, out DateTime value) 16 | { 17 | var token = tokens.Peek(); 18 | if (token == null || token.TokenType != ModelTokenType.Primitive || !(token.Value is string)) 19 | { 20 | value = default(DateTime); 21 | return false; 22 | } 23 | 24 | if (!TryParseDate(token.ValueAsString(), out value)) 25 | { 26 | value = default(DateTime); 27 | return false; 28 | } 29 | 30 | tokens.Pop(); 31 | return true; 32 | } 33 | 34 | public override bool TryWrite(DataWriterSettings settings, DateTime value, out IEnumerable> tokens) 35 | { 36 | tokens = new Token[] 37 | { 38 | ModelGrammar.TokenPrimitive(FormatDate(value)) 39 | }; 40 | 41 | return true; 42 | } 43 | 44 | internal static bool TryParseDate(string date, out DateTime value) 45 | { 46 | return DateTime.TryParseExact(date, DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out value); 47 | } 48 | 49 | private static string FormatDate(DateTime value) 50 | { 51 | return value.ToString(DateFormat); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/TeamCitySharp/Connection/TeamcityJsonEncoderDecoderConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EasyHttp.Codecs; 3 | using EasyHttp.Codecs.JsonFXExtensions; 4 | using EasyHttp.Configuration; 5 | using JsonFx.Json; 6 | using JsonFx.Serialization; 7 | 8 | namespace TeamCitySharp.Connection 9 | { 10 | public class TeamcityJsonEncoderDecoderConfiguration : IEncoderDecoderConfiguration 11 | { 12 | public IEncoder GetEncoder() 13 | { 14 | var jsonWriter = new JsonWriter(new DataWriterSettings(DefaultEncoderDecoderConfiguration.CombinedResolverStrategy() 15 | , new TeamCityDateFilter()), new[] { "application/.*json", "text/.*json" }); 16 | 17 | var writers = new List { jsonWriter }; 18 | var dataWriterProvider = new RegExBasedDataWriterProvider(new List { jsonWriter }); 19 | return new DefaultEncoder(dataWriterProvider); 20 | } 21 | 22 | public IDecoder GetDecoder() 23 | { 24 | var jsonReader = new JsonReader(new DataReaderSettings(DefaultEncoderDecoderConfiguration.CombinedResolverStrategy() 25 | , new TeamCityDateFilter()), new[] { "application/.*json", "text/.*json" }); 26 | 27 | var readers = new List { jsonReader }; 28 | var dataReaderProvider = new RegExBasedDataReaderProvider(readers); 29 | return new DefaultDecoder(dataReaderProvider); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Agent.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Agent 4 | { 5 | public string Name { get; set; } 6 | public string Id { get; set; } 7 | public string Href { get; set; } 8 | 9 | 10 | public override string ToString() 11 | { 12 | return Name; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/AgentRequirement.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class AgentRequirement 4 | { 5 | public override string ToString() 6 | { 7 | return "agent_requirement"; 8 | } 9 | 10 | public string Id { get; set; } 11 | public string Type { get; set; } 12 | public Properties Properties { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/AgentRequirements.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class AgentRequirements 6 | { 7 | public override string ToString() 8 | { 9 | return "agent-requirements"; 10 | } 11 | 12 | public List AgentRequirement { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/AgentWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class AgentWrapper 6 | { 7 | public List Agent { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/ArtifactDependencies.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class ArtifactDependencies 6 | { 7 | public override string ToString() 8 | { 9 | return "artifact-dependencies"; 10 | } 11 | 12 | public List ArtifactDependency { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/ArtifactDependency.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class ArtifactDependency 4 | { 5 | public override string ToString() 6 | { 7 | return "artifact_dependency"; 8 | } 9 | 10 | public string Id { get; set; } 11 | public string Type { get; set; } 12 | public Properties Properties { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Build.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class Build 6 | { 7 | public string Id { get; set; } 8 | public string Number { get; set; } 9 | public string Status { get; set; } 10 | public string BuildTypeId { get; set; } 11 | public string Href { get; set; } 12 | public string WebUrl { get; set; } 13 | public string StatusText { get; set; } 14 | public DateTime StartDate { get; set; } 15 | public DateTime FinishDate { get; set; } 16 | 17 | public BuildConfig BuildConfig { get; set; } 18 | public Agent Agent { get; set;} 19 | public ChangeWrapper Changes { get; set; } 20 | 21 | public override string ToString() 22 | { 23 | return Number; 24 | } 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildConfig.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class BuildConfig 4 | { 5 | public override string ToString() 6 | { 7 | return Name; 8 | } 9 | 10 | public string Id { get; set; } 11 | public string Name { get; set; } 12 | public string Href { get; set; } 13 | public string ProjectId { get; set; } 14 | public string ProjectName { get; set; } 15 | public string Description { get; set; } 16 | public string WebUrl { get; set; } 17 | 18 | public Project Project { get; set; } 19 | 20 | public Parameters Parameters { get; set; } 21 | public ArtifactDependencies ArtifactDependencies { get; set; } 22 | public SnapshotDependencies SnapshotDependencies { get; set; } 23 | public VcsRootEntries VcsRootEntries { get; set; } 24 | public BuildSteps Steps { get; set; } 25 | public AgentRequirements AgentRequirements { get; set; } 26 | public BuildTriggers Triggers { get; set; } 27 | public Properties Settings { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildStep.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class BuildStep 4 | { 5 | public override string ToString() 6 | { 7 | return "step"; 8 | } 9 | public string Id { get; set; } 10 | public string Name { get; set; } 11 | public string Type { get; set; } 12 | public string Disabled { get; set; } 13 | public Properties Properties { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildSteps.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class BuildSteps 6 | { 7 | public override string ToString() 8 | { 9 | return "steps"; 10 | } 11 | 12 | public List Step { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildTrigger.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class BuildTrigger 4 | { 5 | public override string ToString() 6 | { 7 | return "trigger"; 8 | } 9 | 10 | public string Id { get; set; } 11 | public string Type { get; set; } 12 | public Properties Properties { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildTriggers.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class BuildTriggers 6 | { 7 | public override string ToString() 8 | { 9 | return "triggers"; 10 | } 11 | 12 | public List Trigger { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildTypeWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class BuildTypeWrapper 6 | { 7 | public List BuildType { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/BuildWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class BuildWrapper 6 | { 7 | public string Count { get; set; } 8 | public List Build { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Change.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class Change 6 | { 7 | public string Username { get; set; } 8 | public string WebLink { get; set; } 9 | public string Href { get; set; } 10 | public string Id { get; set; } 11 | public string Version { get; set; } 12 | public DateTime Date { get; set; } 13 | public string Comment { get; set; } 14 | 15 | public FileWrapper Files { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/ChangeWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class ChangeWrapper 6 | { 7 | public List Change { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Credentials.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Credentials 4 | { 5 | public string HostName { get; set; } 6 | public string Password { get; set; } 7 | public string UserName { get; set; } 8 | public bool UseSSL { get; set; } 9 | public bool ActAsGuest { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/File.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class File 4 | { 5 | public string relativefile { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/FileWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class FileWrapper 6 | { 7 | public List File { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Group.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Group 4 | { 5 | public override string ToString() 6 | { 7 | return Name; 8 | } 9 | public string Href { get; set; } 10 | public string Name { get; set; } 11 | public string Key { get; set; } 12 | 13 | public UserWrapper Users { get; set; } 14 | public RoleWrapper Roles { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/IBaseEntity.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public interface IBaseEntity 4 | { 5 | string StatusMessage { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Parameters.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class Parameters 6 | { 7 | public override string ToString() 8 | { 9 | return "parameters"; 10 | } 11 | 12 | public List Property { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Plugin.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Plugin 4 | { 5 | public string Name { get; set; } 6 | public string displayName { get; set; } 7 | public string Version { get; set; } 8 | 9 | public override string ToString() 10 | { 11 | return displayName; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/PluginWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class PluginWrapper 6 | { 7 | public List Plugin { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Project.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Project 4 | { 5 | public override string ToString() 6 | { 7 | return Name; 8 | } 9 | 10 | public bool Archived { get; set; } 11 | public string Description { get; set; } 12 | public string Href { get; set; } 13 | public string Id { get; set; } 14 | public string Name { get; set; } 15 | public string WebUrl { get; set; } 16 | 17 | public BuildTypeWrapper BuildTypes { get; set; } 18 | public Parameters Parameters { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/ProjectWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class ProjectWrapper 6 | { 7 | public List Project { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Properties.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class Properties 6 | { 7 | public override string ToString() 8 | { 9 | return "properties"; 10 | } 11 | public List Property { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Property.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Property 4 | { 5 | public override string ToString() 6 | { 7 | return Name; 8 | } 9 | 10 | public string Name { get; set; } 11 | public string Value { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Role.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class Role 4 | { 5 | public string Href { get; set; } 6 | public string Scope { get; set; } 7 | public string RoleId { get; set; } 8 | 9 | public override string ToString() 10 | { 11 | return RoleId; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/RoleWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class RoleWrapper 6 | { 7 | public List Role { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/Server.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class Server 6 | { 7 | public string VersonMajor { get; set; } 8 | public string Version { get; set; } 9 | public string BuildNumber { get; set; } 10 | public DateTime CurrentTime { get; set; } 11 | public DateTime StartTime { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/SnapshotDependencies.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class SnapshotDependencies 6 | { 7 | public override string ToString() 8 | { 9 | return "snapshot-dependencies"; 10 | } 11 | 12 | public List SnapshotDependency { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/SnapshotDependency.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class SnapshotDependency 4 | { 5 | public override string ToString() 6 | { 7 | return "snapshot_dependency"; 8 | } 9 | 10 | public string Id { get; set; } 11 | public Properties Properties { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class User 6 | { 7 | public string Username { get; set; } 8 | public string Name { get; set; } 9 | public string Id { get; set; } 10 | public string Href { get; set; } 11 | public string Email { get; set; } 12 | public string Realm { get; set; } 13 | public DateTime LastLogin { get; set; } 14 | 15 | public Properties Properties { get; set; } 16 | public RoleWrapper Roles { get; set; } 17 | public UserGroupWrapper Groups { get; set; } 18 | 19 | public override string ToString() 20 | { 21 | return Username; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/UserGroupWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class UserGroupWrapper 6 | { 7 | public List Group { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/UserWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class UserWrapper 6 | { 7 | public List User { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/VcsRoot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class VcsRoot 6 | { 7 | public string Id { get; set; } 8 | public string vcsName { get; set; } 9 | public string Href { get; set; } 10 | public string Name { get; set; } 11 | public string Version { get; set; } 12 | public string Status { get; set; } 13 | public DateTime lastChecked { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | return Name; 18 | } 19 | 20 | public Properties Properties { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/VcsRootEntries.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class VcsRootEntries 6 | { 7 | public override string ToString() 8 | { 9 | return "vcs-root-entries"; 10 | } 11 | 12 | public List VcsRootEntry { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/VcsRootEntry.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public class VcsRootEntry 4 | { 5 | public override string ToString() 6 | { 7 | return "vcs-root-entry"; 8 | } 9 | 10 | public VcsRoot VcsRoot { get; set; } 11 | public string CheckoutRules { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/VcsRootField.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.DomainEntities 2 | { 3 | public enum VcsRootField 4 | { 5 | Name, 6 | Shared, 7 | ProjectId 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/DomainEntities/VcsRootWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TeamCitySharp.DomainEntities 4 | { 5 | public class VcsRootWrapper 6 | { 7 | public List VcsRoot { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/ITeamCityClient.cs: -------------------------------------------------------------------------------- 1 | using TeamCitySharp.ActionTypes; 2 | 3 | namespace TeamCitySharp 4 | { 5 | public interface ITeamCityClient 6 | { 7 | void Connect(string userName, string password); 8 | void ConnectAsGuest(); 9 | bool Authenticate(); 10 | 11 | IBuilds Builds { get; } 12 | IBuildConfigs BuildConfigs { get; } 13 | IProjects Projects { get; } 14 | IServerInformation ServerInformation { get; } 15 | IUsers Users { get; } 16 | IAgents Agents { get; } 17 | IVcsRoots VcsRoots { get; } 18 | IChanges Changes { get; } 19 | IBuildArtifacts Artifacts { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/Locators/BuildLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace TeamCitySharp.Locators 5 | { 6 | public enum BuildStatus 7 | { 8 | SUCCESS, 9 | FAILURE, 10 | ERROR 11 | } 12 | 13 | public class BuildLocator 14 | { 15 | public static BuildLocator WithId(long id) 16 | { 17 | return new BuildLocator {Id = id}; 18 | } 19 | 20 | public static BuildLocator WithNumber(string number) 21 | { 22 | return new BuildLocator {Number = number}; 23 | } 24 | 25 | public static BuildLocator RunningBuilds() 26 | { 27 | return new BuildLocator {Running = true}; 28 | } 29 | 30 | public static BuildLocator WithDimensions(BuildTypeLocator buildType = null, 31 | UserLocator user = null, 32 | string agentName = null, 33 | BuildStatus? status = null, 34 | bool? personal = null, 35 | bool? canceled = null, 36 | bool? running = null, 37 | bool? pinned = null, 38 | int? maxResults = null, 39 | int? startIndex = null, 40 | BuildLocator sinceBuild = null, 41 | DateTime? sinceDate = null, 42 | string[] tags = null, 43 | string branch = null 44 | ) 45 | { 46 | return new BuildLocator 47 | { 48 | BuildType = buildType, 49 | User = user, 50 | AgentName = agentName, 51 | Status = status, 52 | Personal = personal, 53 | Canceled = canceled, 54 | Running = running, 55 | Pinned = pinned, 56 | MaxResults = maxResults, 57 | StartIndex = startIndex, 58 | SinceBuild = sinceBuild, 59 | SinceDate = sinceDate, 60 | Tags = tags, 61 | Branch = branch 62 | }; 63 | } 64 | 65 | public long? Id { get; private set; } 66 | public string Number { get; private set; } 67 | public string[] Tags { get; private set; } 68 | public BuildTypeLocator BuildType { get; private set; } 69 | public UserLocator User { get; private set; } 70 | public string AgentName { get; private set; } 71 | public BuildStatus? Status { get; private set; } 72 | public BuildLocator SinceBuild { get; private set; } 73 | public bool? Personal { get; private set; } 74 | public bool? Canceled { get; private set; } 75 | public bool? Running { get; private set; } 76 | public bool? Pinned { get; private set; } 77 | public int? MaxResults { get; private set; } 78 | public int? StartIndex { get; private set; } 79 | public DateTime? SinceDate { get; private set; } 80 | public string Branch { get; private set; } 81 | 82 | public override string ToString() 83 | { 84 | if (Id != null) 85 | { 86 | return "id:" + Id; 87 | } 88 | 89 | if (Number != null) 90 | { 91 | return "number:" + Number; 92 | } 93 | 94 | var locatorFields = new List(); 95 | 96 | if (BuildType != null) 97 | { 98 | locatorFields.Add("buildType:(" + BuildType + ")"); 99 | } 100 | 101 | if (User != null) 102 | { 103 | locatorFields.Add("user:(" + User + ")"); 104 | } 105 | 106 | if (Tags != null) 107 | { 108 | locatorFields.Add("tags:(" + string.Join(",", Tags) + ")"); 109 | } 110 | 111 | if (SinceBuild != null) 112 | { 113 | locatorFields.Add("sinceBuild:(" + SinceBuild + ")"); 114 | } 115 | 116 | if (!string.IsNullOrEmpty(AgentName)) 117 | { 118 | locatorFields.Add("agentName:" + AgentName); 119 | } 120 | 121 | if (Status.HasValue) 122 | { 123 | locatorFields.Add("status:" + Status.Value.ToString()); 124 | } 125 | 126 | if (Personal.HasValue) 127 | { 128 | locatorFields.Add("personal:" + Personal.Value.ToString()); 129 | } 130 | 131 | if (Canceled.HasValue) 132 | { 133 | locatorFields.Add("canceled:" + Canceled.Value.ToString()); 134 | } 135 | 136 | if (Running.HasValue) 137 | { 138 | locatorFields.Add("running:" + Running.Value.ToString()); 139 | } 140 | 141 | if (Pinned.HasValue) 142 | { 143 | locatorFields.Add("pinned:" + Pinned.Value.ToString()); 144 | } 145 | 146 | if (MaxResults.HasValue) 147 | { 148 | locatorFields.Add("count:" + MaxResults.Value.ToString()); 149 | } 150 | 151 | if (StartIndex.HasValue) 152 | { 153 | locatorFields.Add("start:" + StartIndex.Value.ToString()); 154 | } 155 | 156 | if (SinceDate.HasValue) 157 | { 158 | locatorFields.Add("sinceDate:" + 159 | SinceDate.Value.ToString("yyyyMMdd'T'HHmmsszzzz").Replace(":", "").Replace("+", "-")); 160 | } 161 | 162 | if (Branch != null) 163 | { 164 | locatorFields.Add("branch:(" + Branch + ")"); 165 | } 166 | 167 | return string.Join(",", locatorFields.ToArray()); 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/Locators/BuildTypeLocator.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.Locators 2 | { 3 | public class BuildTypeLocator 4 | { 5 | public static BuildTypeLocator WithId(string id) 6 | { 7 | return new BuildTypeLocator { Id = id }; 8 | } 9 | 10 | public static BuildTypeLocator WithName(string name) 11 | { 12 | return new BuildTypeLocator { Name = name }; 13 | } 14 | 15 | public string Id { get; private set; } 16 | public string Name { get; private set; } 17 | 18 | public override string ToString() 19 | { 20 | if (!string.IsNullOrEmpty(Id)) 21 | { 22 | return "id:" + Id; 23 | } 24 | return "name:" + Name; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/TeamCitySharp/Locators/UserLocator.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.Locators 2 | { 3 | public class UserLocator 4 | { 5 | public static UserLocator WithId(string id) 6 | { 7 | return new UserLocator { Id = id }; 8 | } 9 | 10 | public static UserLocator WithUserName(string userName) 11 | { 12 | return new UserLocator { UserName = userName }; 13 | } 14 | 15 | public string Id { get; private set; } 16 | public string UserName { get; private set; } 17 | 18 | public override string ToString() 19 | { 20 | if (!string.IsNullOrEmpty(Id)) 21 | { 22 | return "id:" + Id; 23 | } 24 | return "username:" + UserName; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/TeamCitySharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TeamCitySharpAPI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Paul Stack")] 12 | [assembly: AssemblyProduct("TeamCitySharpAPI")] 13 | [assembly: AssemblyCopyright("Copyright © Paul Stack 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("697ed286-c2e7-49b9-8573-d7b06fc5a329")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.3.3")] 36 | [assembly: AssemblyFileVersion("0.3.3")] 37 | 38 | [assembly: InternalsVisibleTo("TeamCitySharp.UnitTests")] 39 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] 40 | -------------------------------------------------------------------------------- /src/TeamCitySharp/TeamCityClient.cs: -------------------------------------------------------------------------------- 1 | using TeamCitySharp.ActionTypes; 2 | using TeamCitySharp.Connection; 3 | 4 | namespace TeamCitySharp 5 | { 6 | public class TeamCityClient : IClientConnection, ITeamCityClient 7 | { 8 | private readonly TeamCityCaller _caller; 9 | private IBuilds _builds; 10 | private IProjects _projects; 11 | private IBuildConfigs _buildConfigs; 12 | private IServerInformation _serverInformation; 13 | private IUsers _users; 14 | private IAgents _agents; 15 | private IVcsRoots _vcsRoots; 16 | private IChanges _changes; 17 | private IBuildArtifacts _artifacts; 18 | 19 | public TeamCityClient(string hostName, bool useSsl = false) 20 | { 21 | _caller = new TeamCityCaller(hostName, useSsl); 22 | } 23 | 24 | public void Connect(string userName, string password) 25 | { 26 | _caller.Connect(userName, password, false); 27 | } 28 | 29 | public void ConnectAsGuest() 30 | { 31 | _caller.Connect(string.Empty, string.Empty, true); 32 | } 33 | 34 | public bool Authenticate() 35 | { 36 | return _caller.Authenticate("/app/rest"); 37 | } 38 | 39 | public IBuilds Builds 40 | { 41 | get { return _builds ?? (_builds = new Builds(_caller)); } 42 | } 43 | 44 | public IBuildConfigs BuildConfigs 45 | { 46 | get { return _buildConfigs ?? (_buildConfigs = new BuildConfigs(_caller)); } 47 | } 48 | 49 | public IProjects Projects 50 | { 51 | get { return _projects ?? (_projects = new Projects(_caller)); } 52 | } 53 | 54 | public IServerInformation ServerInformation 55 | { 56 | get { return _serverInformation ?? (_serverInformation = new ServerInformation(_caller)); } 57 | } 58 | 59 | public IUsers Users 60 | { 61 | get { return _users ?? (_users = new Users(_caller)); } 62 | } 63 | 64 | public IAgents Agents 65 | { 66 | get { return _agents ?? (_agents = new Agents(_caller)); } 67 | } 68 | 69 | public IVcsRoots VcsRoots 70 | { 71 | get { return _vcsRoots ?? (_vcsRoots = new VcsRoots(_caller)); } 72 | } 73 | 74 | public IChanges Changes 75 | { 76 | get { return _changes ?? (_changes = new Changes(_caller)); } 77 | } 78 | 79 | public IBuildArtifacts Artifacts 80 | { 81 | get { return _artifacts ?? (_artifacts = new BuildArtifacts(_caller)); } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/TeamCitySharp/TeamCitySharp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {87598714-132F-478E-866E-8C1AF3E83057} 9 | Library 10 | Properties 11 | TeamCitySharp 12 | TeamCitySharp 13 | v4.5.2 14 | 512 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | false 36 | 37 | 38 | 39 | ..\..\packages\EasyHttp.1.6.1.0\lib\net40\EasyHttp.dll 40 | True 41 | 42 | 43 | ..\..\packages\JsonFx.2.0.1209.2802\lib\net40\JsonFx.dll 44 | True 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 137 | -------------------------------------------------------------------------------- /src/TeamCitySharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("IntegrationTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("IntegrationTests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("904b02b8-18c4-4df0-9cf8-6fc55c0ada71")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleAgentUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using NUnit.Framework; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | public class when_interacting_to_get_agent_details 12 | { 13 | private ITeamCityClient _client; 14 | 15 | [SetUp] 16 | public void SetUp() 17 | { 18 | _client = new TeamCityClient("teamcity.codebetter.com"); 19 | _client.Connect("teamcitysharpuser", "qwerty"); 20 | } 21 | 22 | [Test] 23 | [ExpectedException(typeof(ArgumentNullException))] 24 | public void it_throws_exception_when_no_host() 25 | { 26 | var client = new TeamCityClient(null); 27 | 28 | //Assert: Exception 29 | } 30 | 31 | [Test] 32 | [ExpectedException(typeof(WebException))] 33 | public void it_throws_exception_when_host_url_invalid() 34 | { 35 | var client = new TeamCityClient("teamcity:81"); 36 | client.Connect("teamcitysharpuser", "qwerty"); 37 | 38 | var agents = client.Agents.All(); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | [Test] 44 | [ExpectedException(typeof(ArgumentException))] 45 | public void it_throws_exception_when_no_client_connection_made() 46 | { 47 | var client = new TeamCityClient("teamcity.codebetter.com"); 48 | 49 | var agents = client.Agents.All(); 50 | 51 | //Assert: Exception 52 | } 53 | 54 | [Test] 55 | public void it_returns_all_agents() 56 | { 57 | List agents = _client.Agents.All(); 58 | 59 | Assert.That(agents.Any(), "No agents were found"); 60 | } 61 | 62 | [TestCase("agent01")] 63 | public void it_returns_last_build_status_for_agent(string agentName) 64 | { 65 | Build lastBuild = _client.Builds.LastBuildByAgent(agentName); 66 | 67 | Assert.That(lastBuild != null, "No build information found for the last build on the specified agent"); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleBuildsConfigsUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using NUnit.Framework; 5 | using TeamCitySharp.Locators; 6 | 7 | namespace TeamCitySharp.IntegrationTests 8 | { 9 | [TestFixture] 10 | public class when_interations_to_get_build_configuration_details 11 | { 12 | private ITeamCityClient _client; 13 | 14 | [SetUp] 15 | public void SetUp() 16 | { 17 | _client = new TeamCityClient("teamcity.codebetter.com"); 18 | _client.Connect("teamcitysharpuser", "qwerty"); 19 | } 20 | 21 | [Test] 22 | [ExpectedException(typeof(ArgumentNullException))] 23 | public void it_throws_exception_when_no_url_passed() 24 | { 25 | var client = new TeamCityClient(null); 26 | 27 | //Assert: Exception 28 | } 29 | 30 | [Test] 31 | [ExpectedException(typeof(WebException))] 32 | public void it_throws_exception_when_host_does_not_exist() 33 | { 34 | var client = new TeamCityClient("test:81"); 35 | client.Connect("teamcitysharpuser", "qwerty"); 36 | 37 | var builds = client.BuildConfigs.All(); 38 | 39 | //Assert: Exception 40 | } 41 | 42 | [Test] 43 | [ExpectedException(typeof(ArgumentException))] 44 | public void it_throws_exception_when_no_connection_formed() 45 | { 46 | var client = new TeamCityClient("teamcity.codebetter.com"); 47 | 48 | var builds = client.BuildConfigs.All(); 49 | 50 | //Assert: Exception 51 | } 52 | 53 | [Test] 54 | public void it_returns_all_build_types() 55 | { 56 | var buildConfigs = _client.BuildConfigs.All(); 57 | 58 | Assert.That(buildConfigs.Any(), "No build types were found in this server"); 59 | } 60 | 61 | [Test] 62 | public void it_returns_build_config_details_by_configuration_id() 63 | { 64 | string buildConfigId = "bt437"; 65 | var buildConfig = _client.BuildConfigs.ByConfigurationId(buildConfigId); 66 | 67 | Assert.That(buildConfig != null, "Cannot find a build type for that buildId"); 68 | } 69 | 70 | [Test] 71 | public void it_pauses_configuration() 72 | { 73 | string buildConfigId = "bt437"; 74 | var buildLocator = BuildTypeLocator.WithId(buildConfigId); 75 | _client.BuildConfigs.SetConfigurationPauseStatus(buildLocator, true); 76 | var status = _client.BuildConfigs.GetConfigurationPauseStatus(buildLocator); 77 | Assert.That(status == true, "Build not paused"); 78 | } 79 | 80 | [Test] 81 | public void it_unpauses_configuration() 82 | { 83 | string buildConfigId = "bt437"; 84 | var buildLocator = BuildTypeLocator.WithId(buildConfigId); 85 | _client.BuildConfigs.SetConfigurationPauseStatus(buildLocator, false); 86 | var status = _client.BuildConfigs.GetConfigurationPauseStatus(buildLocator); 87 | Assert.That(status == false, "Build not unpaused"); 88 | } 89 | 90 | [Test] 91 | public void it_returns_build_config_details_by_configuration_name() 92 | { 93 | string buildConfigName = "Release Build"; 94 | var buildConfig = _client.BuildConfigs.ByConfigurationName(buildConfigName); 95 | 96 | Assert.That(buildConfig != null, "Cannot find a build type for that buildName"); 97 | } 98 | 99 | [Test] 100 | public void it_returns_build_configs_by_project_id() 101 | { 102 | string projectId = "project137"; 103 | var buildConfigs = _client.BuildConfigs.ByProjectId(projectId); 104 | 105 | Assert.That(buildConfigs.Any(), "Cannot find a build type for that projectId"); 106 | } 107 | 108 | [Test] 109 | public void it_returns_build_configs_by_project_name() 110 | { 111 | string projectName = "YouTrackSharp"; 112 | var buildConfigs = _client.BuildConfigs.ByProjectName(projectName); 113 | 114 | Assert.That(buildConfigs.Any(), "Cannot find a build type for that projectName"); 115 | } 116 | } 117 | } -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleBuildsUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using NUnit.Framework; 5 | using TeamCitySharp.Locators; 6 | 7 | namespace TeamCitySharp.IntegrationTests 8 | { 9 | [TestFixture] 10 | public class when_interacting_to_get_build_status_info 11 | { 12 | private ITeamCityClient _client; 13 | 14 | [SetUp] 15 | public void SetUp() 16 | { 17 | _client = new TeamCityClient("teamcity.codebetter.com"); 18 | _client.Connect("teamcitysharpuser", "qwerty"); 19 | } 20 | 21 | [Test] 22 | [ExpectedException(typeof(ArgumentNullException))] 23 | public void it_throws_exception_when_no_url_passed() 24 | { 25 | new TeamCityClient(null); 26 | 27 | //Assert: Exception 28 | } 29 | 30 | [Test] 31 | [ExpectedException(typeof(WebException))] 32 | public void it_throws_exception_when_host_does_not_exist() 33 | { 34 | var client = new TeamCityClient("test:81"); 35 | client.Connect("admin", "qwerty"); 36 | 37 | const string buildConfigId = "Release Build"; 38 | client.Builds.SuccessfulBuildsByBuildConfigId(buildConfigId); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | [Test] 44 | [ExpectedException(typeof(ArgumentException))] 45 | public void it_throws_exception_when_no_connection_formed() 46 | { 47 | var client = new TeamCityClient("teamcity.codebetter.com"); 48 | 49 | const string buildConfigId = "Release Build"; 50 | client.Builds.SuccessfulBuildsByBuildConfigId(buildConfigId); 51 | 52 | //Assert: Exception 53 | } 54 | 55 | [Test] 56 | public void it_returns_last_successful_build_by_build_config_id() 57 | { 58 | const string buildConfigId = "bt437"; 59 | var build = _client.Builds.LastSuccessfulBuildByBuildConfigId(buildConfigId); 60 | 61 | Assert.That(build != null, "No successful builds have been found"); 62 | } 63 | 64 | [Test] 65 | public void it_returns_last_successful_builds_by_build_config_id() 66 | { 67 | const string buildConfigId = "bt437"; 68 | var buildDetails = _client.Builds.SuccessfulBuildsByBuildConfigId(buildConfigId); 69 | 70 | Assert.That(buildDetails.Any(), "No successful builds have been found"); 71 | } 72 | 73 | [Test] 74 | public void it_returns_last_failed_build_by_build_config_id() 75 | { 76 | const string buildConfigId = "bt437"; 77 | var buildDetails = _client.Builds.LastFailedBuildByBuildConfigId(buildConfigId); 78 | 79 | Assert.That(buildDetails != null, "No failed builds have been found"); 80 | } 81 | 82 | [Test] 83 | public void it_returns_all_non_successful_builds_by_config_id() 84 | { 85 | const string buildConfigId = "bt437"; 86 | var builds = _client.Builds.FailedBuildsByBuildConfigId(buildConfigId); 87 | 88 | Assert.That(builds.Any(), "No failed builds have been found"); 89 | } 90 | 91 | [Test] 92 | public void it_returns_last_error_build_by_config_id() 93 | { 94 | const string buildConfigId = "bt437"; 95 | var buildDetails = _client.Builds.LastErrorBuildByBuildConfigId(buildConfigId); 96 | 97 | Assert.That(buildDetails != null, "No errored builds have been found"); 98 | } 99 | 100 | [Test] 101 | public void it_returns_all_error_builds_by_config_id() 102 | { 103 | const string buildId = "bt437"; 104 | var builds = _client.Builds.ErrorBuildsByBuildConfigId(buildId); 105 | 106 | Assert.That(builds.Any(), "No errored builds have been found"); 107 | } 108 | 109 | [Test] 110 | public void it_returns_the_last_build_status_by_build_config_id() 111 | { 112 | const string buildConfigId = "bt437"; 113 | var build = _client.Builds.LastBuildByBuildConfigId(buildConfigId); 114 | 115 | Assert.That(build != null, "No builds for this build config have been found"); 116 | } 117 | 118 | [Test] 119 | public void it_returns_all_builds_by_build_config_id() 120 | { 121 | const string buildConfigId = "bt437"; 122 | var builds = _client.Builds.ByBuildConfigId(buildConfigId); 123 | 124 | Assert.That(builds.Any(), "No builds for this build configuration have been found"); 125 | } 126 | 127 | [Test] 128 | public void it_returns_all_builds_by_build_config_id_and_tag() 129 | { 130 | const string buildConfigId = "bt437"; 131 | const string tag = "Release"; 132 | var builds = _client.Builds.ByConfigIdAndTag(buildConfigId, tag); 133 | 134 | Assert.IsNotNull(builds, "No builds were found for this build id and Tag"); 135 | } 136 | 137 | [Test] 138 | public void it_returns_all_builds_by_username() 139 | { 140 | const string userName = "teamcitysharpuser"; 141 | var builds = _client.Builds.ByUserName(userName); 142 | 143 | Assert.IsNotNull(builds, "No builds for this user have been found"); 144 | } 145 | 146 | [Test] 147 | public void it_returns_all_non_successful_builds_by_username() 148 | { 149 | const string userName = "teamcitysharpuser"; 150 | var builds = _client.Builds.NonSuccessfulBuildsForUser(userName); 151 | 152 | Assert.IsNotNull(builds, "No non successful builds found for this user"); 153 | } 154 | 155 | [Test] 156 | public void it_returns_all_non_successful_build_count_by_username() 157 | { 158 | const string userName = "teamcitysharpuser"; 159 | var builds = _client.Builds.NonSuccessfulBuildsForUser(userName); 160 | 161 | Assert.IsNotNull(builds, "No non successful builds found for this user"); 162 | } 163 | 164 | [Test] 165 | public void it_returns_all_running_builds() 166 | { 167 | var builds = _client.Builds.ByBuildLocator(BuildLocator.RunningBuilds()); 168 | 169 | Assert.IsNotNull(builds, "There are currently no running builds"); 170 | } 171 | 172 | [Test] 173 | public void it_returns_all_successful_builds_since_date() 174 | { 175 | var builds = _client.Builds.AllBuildsOfStatusSinceDate(DateTime.Now.AddDays(-2), BuildStatus.FAILURE); 176 | 177 | Assert.IsNotNull(builds); 178 | } 179 | 180 | [Test] 181 | public void it_does_not_populate_the_status_text_field_of_the_build_object() 182 | { 183 | const string buildConfigId = "bt5"; 184 | var client = new TeamCityClient("localhost:81"); 185 | client.Connect("admin", "qwerty"); 186 | 187 | var build = 188 | client.Builds.ByBuildLocator(BuildLocator.WithDimensions(BuildTypeLocator.WithId(buildConfigId), 189 | maxResults: 1)); 190 | Assert.That(build.Count == 1); 191 | Assert.IsNull(build[0].StatusText); 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleChangeUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using NUnit.Framework; 5 | using System.Collections.Generic; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | public class when_interacting_to_get_change_information 12 | { 13 | private ITeamCityClient _client; 14 | 15 | [SetUp] 16 | public void SetUp() 17 | { 18 | _client = new TeamCityClient("teamcity.codebetter.com"); 19 | _client.Connect("teamcitysharpuser", "qwerty"); 20 | } 21 | 22 | [Test] 23 | [ExpectedException(typeof(ArgumentNullException))] 24 | public void it_returns_exception_when_no_host_specified() 25 | { 26 | var client = new TeamCityClient(null); 27 | 28 | //Assert: Exception 29 | } 30 | 31 | [Test] 32 | [ExpectedException(typeof(WebException))] 33 | public void it_returns_exception_when_host_does_not_exist() 34 | { 35 | var client = new TeamCityClient("test:81"); 36 | client.Connect("admin", "qwerty"); 37 | 38 | var changes = client.Changes.All(); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | [Test] 44 | [ExpectedException(typeof(ArgumentException))] 45 | public void it_returns_exception_when_no_connection_made() 46 | { 47 | var client = new TeamCityClient("teamcity.codebetter.com"); 48 | 49 | var changes = client.Changes.All(); 50 | 51 | //Assert: Exception 52 | } 53 | 54 | [Test] 55 | public void it_returns_all_changes() 56 | { 57 | List changes = _client.Changes.All(); 58 | 59 | Assert.That(changes.Any(), "Cannot find any changes recorded in any of the projects"); 60 | } 61 | 62 | [TestCase("42843")] 63 | public void it_returns_change_details_by_change_id(string changeId) 64 | { 65 | Change changeDetails = _client.Changes.ByChangeId(changeId); 66 | 67 | Assert.That(changeDetails != null, "Cannot find details of that specified change"); 68 | } 69 | 70 | [TestCase("bt113")] 71 | public void it_returns_change_details_for_build_config(string buildConfigId) 72 | { 73 | Change changeDetails = _client.Changes.LastChangeDetailByBuildConfigId(buildConfigId); 74 | 75 | Assert.That(changeDetails != null, "Cannot find details of that specified change"); 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleConnectionUsage.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Authentication; 2 | using NUnit.Framework; 3 | 4 | namespace TeamCitySharp.IntegrationTests 5 | { 6 | [TestFixture] 7 | public class when_connecting_to_the_teamcity_server 8 | { 9 | private ITeamCityClient _client; 10 | 11 | [SetUp] 12 | public void SetUp() 13 | { 14 | _client = new TeamCityClient("localhost:81"); 15 | 16 | } 17 | 18 | [Test] 19 | public void it_will_authenticate_a_known_user() 20 | { 21 | _client.Connect("admin", "qwerty"); 22 | 23 | Assert.That(_client.Authenticate()); 24 | } 25 | 26 | [Test] 27 | [ExpectedException(typeof(AuthenticationException))] 28 | public void it_will_throw_an_exception_for_an_unknown_user() 29 | { 30 | _client.Connect("smithy", "smithy"); 31 | _client.Authenticate(); 32 | 33 | //Assert.Throws Exception 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleCreateUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Authentication; 5 | using System.Text; 6 | using NUnit.Framework; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | [Ignore] 12 | public class when_team_city_client_is_asked_to_create_a_new_user_with_a_password 13 | { 14 | private ITeamCityClient _client; 15 | 16 | [SetUp] 17 | public void SetUp() 18 | { 19 | _client = new TeamCityClient("teamcity.codebetter.com"); 20 | _client.Connect("teamcitysharpuser", "qwerty"); 21 | } 22 | 23 | [Test] 24 | public void it_will_add_a_new_user_and_new_user_will_be_able_to_log_in() 25 | { 26 | string userName = "John.Doe"; 27 | string name = "John Doe"; 28 | string email = "John.Doe@test.com"; 29 | string password = "J0hnD03"; 30 | 31 | var createUserResult = _client.Users.Create(userName, name, email, password); 32 | 33 | ITeamCityClient _newUser; 34 | _newUser = new TeamCityClient("teamcity.codebetter.com"); 35 | _newUser.Connect(userName, password); 36 | 37 | var loginResponse = _newUser.Authenticate(); 38 | 39 | Assert.That(createUserResult && loginResponse); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleProjectUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using NUnit.Framework; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | public class when_interacting_to_get_project_details 12 | { 13 | private ITeamCityClient _client; 14 | 15 | [SetUp] 16 | public void SetUp() 17 | { 18 | _client = new TeamCityClient("teamcity.codebetter.com"); 19 | _client.Connect("teamcitysharpuser", "qwerty"); 20 | } 21 | 22 | [Test] 23 | [ExpectedException(typeof(ArgumentNullException))] 24 | public void it_throws_exception_when_not_passing_url() 25 | { 26 | var client = new TeamCityClient(null); 27 | 28 | //Assert: Exception 29 | } 30 | 31 | [Test] 32 | [ExpectedException(typeof(WebException))] 33 | public void it_throws_exception_when_host_does_not_exist() 34 | { 35 | var client = new TeamCityClient("test:81"); 36 | client.Connect("admin", "qwerty"); 37 | 38 | var allProjects = client.Projects.All(); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | 44 | [Test] 45 | [ExpectedException(typeof(ArgumentException))] 46 | public void it_throws_exception_when_no_connection_formed() 47 | { 48 | var client = new TeamCityClient("teamcity.codebetter.com"); 49 | 50 | var projects = client.Projects.All(); 51 | 52 | //Assert: Exception 53 | } 54 | 55 | [Test] 56 | public void it_returns_all_projects() 57 | { 58 | List projects = _client.Projects.All(); 59 | 60 | Assert.That(projects.Any(), "No projects were found for this server"); 61 | } 62 | 63 | [TestCase("project137")] 64 | public void it_returns_project_details_when_passing_a_project_id(string projectId) 65 | { 66 | Project projectDetails = _client.Projects.ById(projectId); 67 | 68 | Assert.That(projectDetails != null, "No details found for that specific project"); 69 | } 70 | 71 | [TestCase("YouTrackSharp")] 72 | public void it_returns_project_details_when_passing_a_project_name(string projectName) 73 | { 74 | Project projectDetails = _client.Projects.ByName(projectName); 75 | 76 | Assert.That(projectDetails != null, "No details found for that specific project"); 77 | } 78 | 79 | [Test] 80 | public void it_returns_project_details_when_passing_project() 81 | { 82 | var project = new Project { Id = "project137" }; 83 | Project projectDetails = _client.Projects.Details(project); 84 | 85 | Assert.That(!string.IsNullOrWhiteSpace(projectDetails.Id)); 86 | } 87 | 88 | 89 | [Test] 90 | public void it_returns_project_details_when_creating_project() 91 | { 92 | var client = new TeamCityClient("localhost:81"); 93 | client.Connect("admin", "qwerty"); 94 | var projectName = Guid.NewGuid().ToString("N"); 95 | var project = client.Projects.Create(projectName); 96 | 97 | Assert.That(project, Is.Not.Null); 98 | Assert.That(project.Name, Is.EqualTo(projectName)); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleServerUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using System.Net; 5 | using NUnit.Framework; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | public class when_interacting_to_get_server_info 12 | { 13 | private ITeamCityClient _client; 14 | 15 | [SetUp] 16 | public void SetUp() 17 | { 18 | _client = new TeamCityClient("localhost:81"); 19 | _client.Connect("admin", "qwerty"); 20 | } 21 | 22 | [Test] 23 | [ExpectedException(typeof(ArgumentNullException))] 24 | public void it_throws_exception_when_no_url_passed() 25 | { 26 | var client = new TeamCityClient(null); 27 | 28 | //Assert: Exception 29 | } 30 | 31 | [Test] 32 | [ExpectedException(typeof(WebException))] 33 | public void it_throws_exception_when_host_does_not_exist() 34 | { 35 | var client = new TeamCityClient("test:81"); 36 | client.Connect("admin", "qwerty"); 37 | 38 | var plugins = client.ServerInformation.AllPlugins(); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | [Test] 44 | [ExpectedException(typeof(ArgumentException))] 45 | public void it_throws_exception_when_no_connection_formed() 46 | { 47 | var client = new TeamCityClient("teamcity.codebetter.com"); 48 | 49 | var plugins = client.ServerInformation.AllPlugins(); 50 | 51 | //Assert: Exception 52 | } 53 | 54 | [Test] 55 | public void it_returns_server_info() 56 | { 57 | Server serverInfo = _client.ServerInformation.ServerInfo(); 58 | 59 | Assert.That(serverInfo != null, "The server is not returning any information"); 60 | } 61 | 62 | [Test] 63 | public void it_returns_all_server_plugins() 64 | { 65 | List plugins = _client.ServerInformation.AllPlugins(); 66 | 67 | Assert.IsNotNull(plugins, "Server is not returning a plugin list"); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleUserUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using NUnit.Framework; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | public class when_interacting_to_get_user_information 12 | { 13 | private ITeamCityClient _client; 14 | 15 | [SetUp] 16 | public void SetUp() 17 | { 18 | _client = new TeamCityClient("teamcity.codebetter.com"); 19 | _client.Connect("teamcitysharpuser", "qwerty"); 20 | } 21 | 22 | [Test] 23 | [ExpectedException(typeof(ArgumentNullException))] 24 | public void it_returns_exception_when_no_host_specified() 25 | { 26 | var client = new TeamCityClient(null); 27 | 28 | //Assert: Exception 29 | } 30 | 31 | [Test] 32 | [ExpectedException(typeof(WebException))] 33 | public void it_returns_exception_when_host_does_not_exist() 34 | { 35 | var client = new TeamCityClient("test:81"); 36 | client.Connect("admin", "qwerty"); 37 | 38 | var users = client.Users.All(); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | [Test] 44 | [ExpectedException(typeof(ArgumentException))] 45 | public void it_returns_exception_when_no_connection_made() 46 | { 47 | var client = new TeamCityClient("teamcity.codebetter.com"); 48 | 49 | var users = client.Users.All(); 50 | 51 | //Assert: Exception 52 | } 53 | 54 | [Test] 55 | public void it_returns_all_user_groups() 56 | { 57 | List groups = _client.Users.AllUserGroups(); 58 | 59 | Assert.That(groups.Any(), "No user groups were found"); 60 | } 61 | 62 | [Test] 63 | public void it_returns_all_users_by_user_group_name() 64 | { 65 | string userGroupName = "ALL_USERS_GROUP"; 66 | List users = _client.Users.AllUsersByUserGroup(userGroupName); 67 | 68 | Assert.That(users.Any(), "No users were found for this group"); 69 | } 70 | 71 | [Test] 72 | public void it_returns_all_roles_by_user_group_name() 73 | { 74 | string userGroupName = "ALL_USERS_GROUP"; 75 | List roles = _client.Users.AllUserRolesByUserGroup(userGroupName); 76 | 77 | Assert.That(roles.Any(), "No roles were found for that userGroup"); 78 | } 79 | 80 | [Test] 81 | public void it_returns_all_users() 82 | { 83 | List users = _client.Users.All(); 84 | 85 | Assert.That(users.Any(), "No users found for this server"); 86 | } 87 | 88 | [Test] 89 | public void it_returns_all_user_roles_by_user_name() 90 | { 91 | string userName = "teamcitysharpuser"; 92 | List roles = _client.Users.AllRolesByUserName(userName); 93 | 94 | Assert.That(roles.Any(), "No roles found for this user"); 95 | } 96 | 97 | [Test] 98 | public void it_returns_all_user_groups_by_user_group_name() 99 | { 100 | string userName = "teamcitysharpuser"; 101 | List groups = _client.Users.AllGroupsByUserName(userName); 102 | 103 | Assert.That(groups.Any(), "This user is not a member of any groups"); 104 | } 105 | 106 | [Test] 107 | public void it_returns_user_details_by_user() 108 | { 109 | string userName = "teamcitysharpuser"; 110 | User details = _client.Users.Details(userName); 111 | 112 | Assert.That(details.Email.ToLowerInvariant().Equals("teamcitysharp@paulstack.co.uk"), "Incorrect email address"); 113 | } 114 | 115 | [Test] 116 | [ExpectedException] 117 | public void it_should_throw_exception_when_forbidden_status_code_returned() 118 | { 119 | var client = new TeamCityClient("localhost:81"); 120 | client.ConnectAsGuest(); 121 | 122 | var users = client.Users.All(); 123 | 124 | //assert: Throws exception 125 | } 126 | } 127 | } -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/SampleVcsUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using NUnit.Framework; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using TeamCitySharp.DomainEntities; 7 | 8 | namespace TeamCitySharp.IntegrationTests 9 | { 10 | [TestFixture] 11 | public class when_interacting_to_get_vcs_details 12 | { 13 | private ITeamCityClient _client; 14 | 15 | [SetUp] 16 | public void SetUp() 17 | { 18 | _client = new TeamCityClient("teamcity.codebetter.com"); 19 | _client.Connect("teamcitysharpuser", "qwerty"); 20 | } 21 | 22 | [Test] 23 | [ExpectedException(typeof(ArgumentNullException))] 24 | public void it_returns_exception_when_no_host_specified() 25 | { 26 | var client = new TeamCityClient(null); 27 | 28 | //Assert: Exception 29 | } 30 | 31 | [Test] 32 | [ExpectedException(typeof(WebException))] 33 | public void it_returns_exception_when_host_does_not_exist() 34 | { 35 | var client = new TeamCityClient("test:81"); 36 | client.Connect("admin", "qwerty"); 37 | 38 | var vcsroots = client.VcsRoots.All(); 39 | 40 | //Assert: Exception 41 | } 42 | 43 | [Test] 44 | [ExpectedException(typeof(ArgumentException))] 45 | public void it_returns_exception_when_no_connection_formed() 46 | { 47 | var client = new TeamCityClient("teamcity.codebetter.com"); 48 | 49 | var vcsRoots = client.VcsRoots.All(); 50 | 51 | //Assert: Exception 52 | } 53 | 54 | [Test] 55 | public void it_returns_all_vcs_roots() 56 | { 57 | List vcsRoots = _client.VcsRoots.All(); 58 | 59 | Assert.That(vcsRoots.Any(), "No VCS Roots were found for the installation"); 60 | } 61 | 62 | [TestCase("1")] 63 | public void it_returns_vcs_details_when_passing_vcs_root_id(string vcsRootId) 64 | { 65 | VcsRoot rootDetails = _client.VcsRoots.ById(vcsRootId); 66 | 67 | Assert.That(rootDetails != null, "Cannot find the specific VCSRoot"); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/TeamCitySharp.IntegrationTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {BA409A09-CC7B-4A71-A3D4-FE27234A721B} 9 | Library 10 | Properties 11 | TeamCitySharp.IntegrationTests 12 | TeamCitySharp.IntegrationTests 13 | v4.5.2 14 | 512 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | false 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | false 35 | 36 | 37 | 38 | ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll 39 | True 40 | 41 | 42 | ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll 43 | True 44 | 45 | 46 | ..\..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll 47 | True 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Code 61 | 62 | 63 | Code 64 | 65 | 66 | 67 | Code 68 | 69 | 70 | 71 | 72 | 73 | Code 74 | 75 | 76 | Code 77 | 78 | 79 | Code 80 | 81 | 82 | 83 | 84 | {87598714-132F-478E-866E-8C1AF3E83057} 85 | TeamCitySharp 86 | 87 | 88 | 89 | 90 | 91 | 92 | 98 | -------------------------------------------------------------------------------- /src/Tests/IntegrationTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Tests/UnitTests/ActionTypes/ServerInformationTest.cs: -------------------------------------------------------------------------------- 1 | namespace TeamCitySharp.ActionTypes 2 | { 3 | using FakeItEasy; 4 | using FluentAssertions; 5 | using NUnit.Framework; 6 | using TeamCitySharp.Connection; 7 | 8 | [TestFixture] 9 | public class ServerInformationTest 10 | { 11 | private ServerInformation testee; 12 | private ITeamCityCaller teamCityCaller; 13 | 14 | [SetUp] 15 | public void SetUp() 16 | { 17 | this.teamCityCaller = A.Fake(); 18 | this.testee = new ServerInformation(this.teamCityCaller); 19 | } 20 | 21 | [TestCase(true, true, true, true)] 22 | [TestCase(false, false, false, false)] 23 | [TestCase(true, false, false, false)] 24 | [TestCase(false, true, false, false)] 25 | [TestCase(false, false, true, false)] 26 | [TestCase(false, false, false, true)] 27 | public void CreatesBackupWithSelectedParts(bool includeBuildLogs, bool includeConfigurations, bool includeDatabase, bool includePersonalChanges) 28 | { 29 | const string Filename = "Filename"; 30 | var backupOptions = new BackupOptions 31 | { 32 | Filename = Filename, 33 | IncludeBuildLogs = includeBuildLogs, 34 | IncludeConfigurations = includeConfigurations, 35 | IncludeDatabase = includeDatabase, 36 | IncludePersonalChanges = includePersonalChanges 37 | }; 38 | 39 | this.testee.TriggerServerInstanceBackup(backupOptions); 40 | 41 | A.CallTo(() => this.teamCityCaller.StartBackup(string.Concat( 42 | "/app/rest/server/backup?fileName=", 43 | Filename, 44 | "&includeBuildLogs=" + includeBuildLogs, 45 | "&includeConfigs=" + includeConfigurations, 46 | "&includeDatabase=" + includeDatabase, 47 | "&includePersonalChanges=" + includePersonalChanges))) 48 | .MustHaveHappened(); 49 | } 50 | 51 | [Test] 52 | public void GetsBackupStatus() 53 | { 54 | const string Status = "Idle"; 55 | 56 | A.CallTo(() => this.teamCityCaller.GetRaw("/app/rest/server/backup")).Returns(Status); 57 | 58 | string status = this.testee.GetBackupStatus(); 59 | 60 | status.Should().Be(Status); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /src/Tests/UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TeamCitySharp.UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TeamCitySharp.UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ffe7fbda-d6b9-459f-9b4d-a8d7858bd053")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/Tests/UnitTests/TeamCitySharp.UnitTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1DA175C4-2A6F-4B52-A9B4-87D382150AE9} 8 | Library 9 | Properties 10 | TeamCitySharp 11 | TeamCitySharp.UnitTests 12 | v4.5.2 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | false 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | true 34 | false 35 | 36 | 37 | 38 | ..\..\..\packages\FakeItEasy.1.10.0\lib\net40\FakeItEasy.dll 39 | True 40 | 41 | 42 | ..\..\..\packages\FluentAssertions.2.0.1\lib\net45\FluentAssertions.dll 43 | True 44 | 45 | 46 | ..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll 47 | True 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | {87598714-132F-478E-866E-8C1AF3E83057} 64 | TeamCitySharp 65 | 66 | 67 | 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /src/Tests/UnitTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | --------------------------------------------------------------------------------