mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-22 00:08:27 +02:00
remove nfluent
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Text;
|
||||
using AwesomeAssertions;
|
||||
using NFluent;
|
||||
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
|
||||
@@ -30,11 +29,11 @@ public class BodyParserTests
|
||||
var body = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// Assert
|
||||
Check.That(body.BodyAsBytes).IsNotNull();
|
||||
Check.That(body.BodyAsJson).IsNotNull();
|
||||
Check.That(body.BodyAsString).Equals(bodyAsJson);
|
||||
Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType);
|
||||
Check.That(body.DetectedBodyTypeFromContentType).IsEqualTo(detectedBodyTypeFromContentType);
|
||||
body.BodyAsBytes.Should().NotBeNull();
|
||||
body.BodyAsJson.Should().NotBeNull();
|
||||
body.BodyAsString.Should().Be(bodyAsJson);
|
||||
body.DetectedBodyType.Should().Be(detectedBodyType);
|
||||
body.DetectedBodyTypeFromContentType.Should().Be(detectedBodyTypeFromContentType);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -54,11 +53,11 @@ public class BodyParserTests
|
||||
var body = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// Assert
|
||||
Check.That(body.BodyAsBytes).IsNotNull();
|
||||
Check.That(body.BodyAsJson).IsNull();
|
||||
Check.That(body.BodyAsString).Equals(bodyAsString);
|
||||
Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType);
|
||||
Check.That(body.DetectedBodyTypeFromContentType).IsEqualTo(detectedBodyTypeFromContentType);
|
||||
body.BodyAsBytes.Should().NotBeNull();
|
||||
body.BodyAsJson.Should().BeNull();
|
||||
body.BodyAsString.Should().Be(bodyAsString);
|
||||
body.DetectedBodyType.Should().Be(detectedBodyType);
|
||||
body.DetectedBodyTypeFromContentType.Should().Be(detectedBodyTypeFromContentType);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -79,7 +78,7 @@ public class BodyParserTests
|
||||
var body = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// assert
|
||||
Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType);
|
||||
body.DetectedBodyType.Should().Be(detectedBodyType);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -100,7 +99,7 @@ public class BodyParserTests
|
||||
var body = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// assert
|
||||
Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType);
|
||||
body.DetectedBodyType.Should().Be(detectedBodyType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -141,11 +140,11 @@ public class BodyParserTests
|
||||
var result = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// Assert
|
||||
Check.That(result.DetectedBodyType).IsEqualTo(BodyType.String);
|
||||
Check.That(result.DetectedBodyTypeFromContentType).IsEqualTo(BodyType.MultiPart);
|
||||
Check.That(result.BodyAsBytes).IsNotNull();
|
||||
Check.That(result.BodyAsJson).IsNull();
|
||||
Check.That(result.BodyAsString).IsNotNull();
|
||||
result.DetectedBodyType.Should().Be(BodyType.String);
|
||||
result.DetectedBodyTypeFromContentType.Should().Be(BodyType.MultiPart);
|
||||
result.BodyAsBytes.Should().NotBeNull();
|
||||
result.BodyAsJson.Should().BeNull();
|
||||
result.BodyAsString.Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -165,11 +164,11 @@ public class BodyParserTests
|
||||
var result = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// Assert
|
||||
Check.That(result.DetectedBodyType).IsEqualTo(BodyType.Bytes);
|
||||
Check.That(result.DetectedBodyTypeFromContentType).IsEqualTo(BodyType.MultiPart);
|
||||
Check.That(result.BodyAsBytes).IsNotNull();
|
||||
Check.That(result.BodyAsJson).IsNull();
|
||||
Check.That(result.BodyAsString).IsNull();
|
||||
result.DetectedBodyType.Should().Be(BodyType.Bytes);
|
||||
result.DetectedBodyTypeFromContentType.Should().Be(BodyType.MultiPart);
|
||||
result.BodyAsBytes.Should().NotBeNull();
|
||||
result.BodyAsJson.Should().BeNull();
|
||||
result.BodyAsString.Should().BeNull();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -188,11 +187,11 @@ public class BodyParserTests
|
||||
var body = await BodyParser.ParseAsync(bodyParserSettings);
|
||||
|
||||
// Assert
|
||||
Check.That(body.BodyAsBytes).IsNotNull();
|
||||
Check.That(body.BodyAsJson).IsNull();
|
||||
Check.That(body.BodyAsString).Equals(bodyAsString);
|
||||
Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType);
|
||||
Check.That(body.DetectedBodyTypeFromContentType).IsEqualTo(detectedBodyTypeFromContentType);
|
||||
body.BodyAsBytes.Should().NotBeNull();
|
||||
body.BodyAsJson.Should().BeNull();
|
||||
body.BodyAsString.Should().Be(bodyAsString);
|
||||
body.DetectedBodyType.Should().Be(detectedBodyType);
|
||||
body.DetectedBodyTypeFromContentType.Should().Be(detectedBodyTypeFromContentType);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -261,7 +260,7 @@ public class BodyParserTests
|
||||
[InlineData("PATCH", true)]
|
||||
public void BodyParser_ShouldParseBodyForMethodAndAllowAllIsFalse_ExpectedResultForKnownMethods(string method, bool resultShouldBe)
|
||||
{
|
||||
Check.That(BodyParser.ShouldParseBody(method, false)).Equals(resultShouldBe);
|
||||
BodyParser.ShouldParseBody(method, false).Should().Be(resultShouldBe);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -278,7 +277,7 @@ public class BodyParserTests
|
||||
[InlineData("SOME-UNKNOWN-METHOD")]
|
||||
public void BodyParser_ShouldParseBodyForMethodAndAllowAllIsTrue_ExpectedResultShouldBeTrue(string method)
|
||||
{
|
||||
Check.That(BodyParser.ShouldParseBody(method, true)).IsTrue();
|
||||
BodyParser.ShouldParseBody(method, true).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -286,6 +285,7 @@ public class BodyParserTests
|
||||
[InlineData("SOME-UNKNOWN-METHOD")]
|
||||
public void BodyParser_ShouldParseBody_DefaultIsTrueForUnknownMethods(string method)
|
||||
{
|
||||
Check.That(BodyParser.ShouldParseBody(method, false)).IsTrue();
|
||||
BodyParser.ShouldParseBody(method, false).Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Text;
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WireMock.Util;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Text;
|
||||
using AwesomeAssertions;
|
||||
using RandomDataGenerator.FieldOptions;
|
||||
using RandomDataGenerator.Randomizers;
|
||||
using WireMock.Util;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Globalization;
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using Moq;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Util;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using NFluent;
|
||||
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
@@ -16,7 +16,7 @@ public class FilePathUtilsTests
|
||||
var cleanPath = FilePathUtils.CleanPath(path);
|
||||
|
||||
// Assert
|
||||
Check.That(cleanPath).Equals("subdirectory" + Path.DirectorySeparatorChar + "MyXmlResponse.xml");
|
||||
cleanPath.Should().Be("subdirectory" + Path.DirectorySeparatorChar + "MyXmlResponse.xml");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -38,6 +38,6 @@ public class FilePathUtilsTests
|
||||
var withoutDirectorySeparators = FilePathUtils.RemoveLeadingDirectorySeparators(cleanPath);
|
||||
|
||||
// Assert
|
||||
Check.That(withoutDirectorySeparators).Equals(expected);
|
||||
withoutDirectorySeparators.Should().Be(expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using System.Net;
|
||||
using WireMock.Util;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Linq.Dynamic.Core;
|
||||
using System.Reflection;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NFluent;
|
||||
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
@@ -65,9 +65,9 @@ public class JsonUtilsTests
|
||||
// Assert
|
||||
var queryable = new[] { instance }.AsQueryable().Select(line);
|
||||
bool result = queryable.Any("it == \"Test\"");
|
||||
Check.That(result).IsTrue();
|
||||
result.Should().BeTrue();
|
||||
|
||||
Check.That(line).IsEqualTo("string(it)");
|
||||
line.Should().Be("string(it)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -192,4 +192,4 @@ public class JsonUtilsTests
|
||||
"System.String get_C()"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Types;
|
||||
using WireMock.Util;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System.Text.RegularExpressions;
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Util;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using AnyOfTypes;
|
||||
using AwesomeAssertions;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Models;
|
||||
using WireMock.Util;
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if NET452
|
||||
using Microsoft.Owin;
|
||||
#else
|
||||
using Microsoft.AspNetCore.Http;
|
||||
#endif
|
||||
using NFluent;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
@@ -22,8 +17,8 @@ public class UrlUtilsTests
|
||||
var result = UrlUtils.Parse(uri, new PathString("/a"));
|
||||
|
||||
// Assert
|
||||
Check.That(result.Url.ToString()).Equals("https://localhost:1234/b?x=0");
|
||||
Check.That(result.AbsoluteUrl.ToString()).Equals("https://localhost:1234/a/b?x=0");
|
||||
result.Url.ToString().Should().Be("https://localhost:1234/b?x=0");
|
||||
result.AbsoluteUrl.ToString().Should().Be("https://localhost:1234/a/b?x=0");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -36,8 +31,8 @@ public class UrlUtilsTests
|
||||
var result = UrlUtils.Parse(uri, new PathString());
|
||||
|
||||
// Assert
|
||||
Check.That(result.Url.ToString()).Equals("https://localhost:1234/a/b?x=0");
|
||||
Check.That(result.AbsoluteUrl.ToString()).Equals("https://localhost:1234/a/b?x=0");
|
||||
result.Url.ToString().Should().Be("https://localhost:1234/a/b?x=0");
|
||||
result.AbsoluteUrl.ToString().Should().Be("https://localhost:1234/a/b?x=0");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -50,7 +45,7 @@ public class UrlUtilsTests
|
||||
var result = UrlUtils.Parse(uri, new PathString("/test"));
|
||||
|
||||
// Assert
|
||||
Check.That(result.Url.ToString()).Equals("https://localhost:1234/a/b?x=0");
|
||||
Check.That(result.AbsoluteUrl.ToString()).Equals("https://localhost:1234/a/b?x=0");
|
||||
result.Url.ToString().Should().Be("https://localhost:1234/a/b?x=0");
|
||||
result.AbsoluteUrl.ToString().Should().Be("https://localhost:1234/a/b?x=0");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user