Ductus.FluentDocker.MsTest
2.10.55
Install-Package Ductus.FluentDocker.MsTest -Version 2.10.55
dotnet add package Ductus.FluentDocker.MsTest --version 2.10.55
<PackageReference Include="Ductus.FluentDocker.MsTest" Version="2.10.55" />
paket add Ductus.FluentDocker.MsTest --version 2.10.55
#r "nuget: Ductus.FluentDocker.MsTest, 2.10.55"
// Install Ductus.FluentDocker.MsTest as a Cake Addin
#addin nuget:?package=Ductus.FluentDocker.MsTest&version=2.10.55
// Install Ductus.FluentDocker.MsTest as a Cake Tool
#tool nuget:?package=Ductus.FluentDocker.MsTest&version=2.10.55
FluentDocker for MsTest
In addition to the standard FluentDocker usage, it adds the ability to use easy testing with containers via MsTest.
For example, fire up a Postgres container inside the test could look like this
[TestClass]
public class PostgresMsTests : PostgresTestBase
{
[TestMethod]
public void Test()
{
// We now have a running Postgres
// and a valid connection string to use.
}
}
This library enables docker
and docker-compose
interactions using a Fluent API. It is supported on Linux, Windows and Mac. It also has support for the legacy docker-machine
interactions.
Have a look at the project site for more information.
Sample Fluent API usage
using (
var container =
new Builder().UseContainer()
.UseImage("kiasaki/alpine-postgres")
.ExposePort(5432)
.WithEnvironment("POSTGRES_PASSWORD=mysecretpassword")
.WaitForPort("5432/tcp", 30000 /*30s*/)
.Build()
.Start())
{
var config = container.GetConfiguration(true);
Assert.AreEqual(ServiceRunningState.Running, config.State.ToServiceState());
}
The following snippet fires up Postgres and waits for it to be ready. It uses docker-compose file to perform the task.
var file = Path.Combine(Directory.GetCurrentDirectory(),
(TemplateString) "Resources/ComposeTests/WordPress/docker-compose.yml");
// @formatter:off
using (var svc = new Builder()
.UseContainer()
.UseCompose()
.FromFile(file)
.RemoveOrphans()
.WaitForHttp("wordpress", "http://localhost:8000/wp-admin/install.php")
.Build().Start())
// @formatter:on
{
// We now have a running WordPress with a MySql database
var installPage = await "http://localhost:8000/wp-admin/install.php".Wget();
Assert.IsTrue(installPage.IndexOf("https://wordpress.org/", StringComparison.Ordinal) != -1);
Assert.AreEqual(1, svc.Hosts.Count); // The host used by compose
Assert.AreEqual(2, svc.Containers.Count); // We can access each individual container
Assert.AreEqual(2, svc.Images.Count); // And the images used.
}
👀 It has tons of features, including a low-level command style, services and finally, the Fluent API on top of it.
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETFramework 4.6.1
- Ductus.FluentDocker (>= 2.10.55)
- MSTest.TestFramework (>= 1.1.17)
-
.NETStandard 2.0
- Ductus.FluentDocker (>= 2.10.55)
- MSTest.TestFramework (>= 1.1.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.10.55 | 43 | 6/24/2022 |
2.10.54 | 42 | 6/24/2022 |
2.10.53 | 41 | 6/23/2022 |
2.10.51 | 146 | 6/7/2022 |
2.10.50 | 54 | 6/7/2022 |
2.10.48 | 338 | 5/30/2022 |
2.10.46 | 64 | 5/30/2022 |
2.10.45 | 1,146 | 3/9/2022 |
2.10.44 | 276 | 12/8/2021 |
2.10.42 | 3,116 | 11/24/2021 |
2.10.41 | 6,532 | 11/23/2021 |
2.10.40 | 501 | 10/27/2021 |
2.10.39 | 528 | 10/1/2021 |
2.10.35 | 225 | 10/1/2021 |
2.10.25 | 260 | 10/1/2021 |
2.10.23 | 278 | 10/1/2021 |
2.10.22 | 243 | 9/29/2021 |
2.10.21 | 283 | 9/19/2021 |
2.10.20 | 256 | 9/17/2021 |
2.10.19 | 251 | 9/16/2021 |
2.10.17 | 278 | 9/16/2021 |
2.10.16 | 274 | 9/15/2021 |
2.10.15 | 204 | 9/15/2021 |
2.10.14 | 280 | 9/14/2021 |
2.10.12 | 301 | 9/14/2021 |
2.10.10 | 293 | 9/13/2021 |
2.10.8 | 335 | 9/13/2021 |
2.10.7 | 852 | 6/11/2021 |
2.10.6 | 793 | 4/23/2021 |
2.10.5 | 329 | 4/20/2021 |
2.10.3 | 356 | 4/5/2021 |
2.10.2 | 285 | 3/28/2021 |
2.9.4 | 324 | 3/26/2021 |
2.9.3-beta.2 | 133 | 3/25/2021 |
2.8.14-beta.22 | 113 | 3/24/2021 |
2.8.13-beta.21 | 122 | 3/24/2021 |
2.8.12-beta.20 | 124 | 3/23/2021 |
2.8.11-beta.19 | 92 | 3/22/2021 |
2.8.10-beta.18 | 98 | 3/22/2021 |
2.8.9-beta.17 | 109 | 3/22/2021 |
2.8.8-beta.14 | 105 | 3/17/2021 |
2.8.7-beta.9 | 128 | 3/11/2021 |
2.8.5-beta.4 | 194 | 3/7/2021 |
2.8.5-beta.2 | 85 | 3/24/2021 |
2.8.4-beta.3 | 91 | 3/3/2021 |
2.8.3 | 336 | 3/24/2021 |
2.8.2 | 305 | 3/3/2021 |
2.7.80-beta.159 | 115 | 3/1/2021 |
2.7.71-beta.150 | 676 | 11/27/2020 |
2.7.69-beta.147 | 171 | 10/12/2020 |
2.7.68-beta.146 | 166 | 10/8/2020 |
2.7.66-beta.142 | 305 | 8/8/2020 |
2.7.65-beta.141 | 171 | 8/7/2020 |
2.7.64-beta.140 | 268 | 8/6/2020 |
2.7.62-beta.138 | 214 | 5/4/2020 |
2.7.60-beta.127 | 214 | 4/30/2020 |
2.7.59-beta0123 | 361 | 2/13/2020 |
2.7.58-beta0122 | 303 | 2/12/2020 |
2.7.54-beta0117 | 376 | 1/23/2020 |
2.7.53-beta0116 | 386 | 1/23/2020 |
2.7.52-beta0105 | 341 | 1/20/2020 |
2.7.51-beta0102 | 311 | 1/14/2020 |
2.7.50-beta0094 | 326 | 12/20/2019 |
2.7.49-beta0091 | 321 | 12/18/2019 |
2.7.48-beta0087 | 352 | 12/17/2019 |
2.7.47-beta0081 | 353 | 12/17/2019 |
2.7.46-beta0080 | 341 | 12/16/2019 |
2.7.45-beta0079 | 308 | 12/12/2019 |
2.7.44-beta0078 | 302 | 12/12/2019 |
2.7.42-beta0076 | 317 | 12/12/2019 |
2.7.41-beta0075 | 308 | 12/12/2019 |
2.7.38-beta0072 | 343 | 11/24/2019 |
2.7.37-beta0071 | 346 | 11/24/2019 |
2.7.36-beta0070 | 344 | 11/24/2019 |
2.7.35-beta0069 | 305 | 11/20/2019 |
2.7.34-beta0068 | 303 | 11/20/2019 |
2.7.33-beta0067 | 317 | 11/20/2019 |
2.7.32-beta0066 | 299 | 11/12/2019 |
2.7.31-beta0064 | 332 | 11/12/2019 |
2.7.30-beta0050 | 322 | 11/8/2019 |
2.7.29-beta0046 | 325 | 11/8/2019 |
2.7.28-beta0045 | 323 | 11/8/2019 |
2.7.27-beta0043 | 326 | 11/8/2019 |
2.7.22-devops-deploy-on0001 | 313 | 11/8/2019 |
2.7.21-devops-editorcon0003 | 324 | 11/8/2019 |
2.7.21-devops-editorcon0002 | 316 | 11/8/2019 |
2.7.21-devops-editorcon0001 | 307 | 11/8/2019 |
2.7.21-beta0036 | 299 | 11/8/2019 |
2.7.20-beta0032 | 312 | 11/8/2019 |
2.7.19-beta0030 | 305 | 11/8/2019 |
2.7.4-beta0001 | 315 | 11/8/2019 |
2.7.3 | 9,852 | 10/18/2019 |
2.7.2 | 566 | 9/10/2019 |
2.7.1 | 659 | 8/7/2019 |
2.7.0 | 508 | 8/6/2019 |
2.6.9 | 471 | 7/29/2019 |
2.6.8 | 528 | 5/31/2019 |
2.6.7 | 581 | 5/17/2019 |
2.6.6 | 628 | 4/11/2019 |
2.6.5 | 546 | 4/2/2019 |
2.6.4 | 1,831 | 12/6/2018 |
2.6.3 | 687 | 10/15/2018 |
2.6.2 | 661 | 10/3/2018 |
2.6.1 | 688 | 10/3/2018 |
2.6.0 | 751 | 10/2/2018 |
2.5.1 | 676 | 9/29/2018 |
2.5.0 | 687 | 9/29/2018 |
2.4.1 | 655 | 9/27/2018 |
2.4.0 | 700 | 9/18/2018 |
2.3.2 | 1,473 | 8/6/2018 |
2.3.1 | 716 | 7/20/2018 |
2.3.0 | 886 | 7/2/2018 |
2.2.19 | 866 | 6/27/2018 |
2.2.18 | 947 | 6/25/2018 |
2.2.17 | 914 | 6/15/2018 |
2.2.16 | 840 | 6/14/2018 |
2.2.15 | 949 | 6/7/2018 |
2.2.14 | 901 | 6/1/2018 |
2.2.13 | 853 | 5/22/2018 |
2.2.12 | 1,125 | 4/20/2018 |
2.2.11 | 876 | 4/18/2018 |
2.2.10 | 866 | 4/17/2018 |
2.2.9 | 982 | 4/6/2018 |
2.2.8 | 3,352 | 11/22/2017 |
2.2.7 | 902 | 11/22/2017 |
2.2.6 | 856 | 11/21/2017 |
2.2.5 | 878 | 11/9/2017 |
2.2.4 | 870 | 11/9/2017 |
2.2.3 | 902 | 8/25/2017 |
2.2.2 | 942 | 5/22/2017 |
2.2.1 | 917 | 4/6/2017 |
2.2.0 | 849 | 6/5/2016 |
2.1.1 | 798 | 5/27/2016 |
2.0.0 | 901 | 4/24/2016 |
1.1.4 | 764 | 3/31/2016 |
1.1.3 | 785 | 3/30/2016 |
1.1.2 | 784 | 3/30/2016 |
1.1.1 | 753 | 3/29/2016 |
1.1.0 | 804 | 3/29/2016 |
1.0.3 | 790 | 3/24/2016 |
1.0.2 | 1,004 | 3/23/2016 |
1.0.1 | 1,013 | 3/23/2016 |