public void WithFileContents_GivenExpectedValue_ShouldPass() { var actualBytes = TestDataGenerator.CreateBytes("Test 1"); var expectedBytes = TestDataGenerator.CreateBytes("Test 1"); ActionResult result = TestDataGenerator.CreateFileContentResult(actualBytes); result.Should() .BeFileContentResult() .WithFileContents(expectedBytes); }
public void WithFileContents_GivenUnexpectedValue_ShouldFail( string actual, string expected, string failureMessage) { var actualBytes = TestDataGenerator.CreateBytes(actual); var expectedBytes = TestDataGenerator.CreateBytes(expected); ActionResult result = TestDataGenerator.CreateFileContentResult(actualBytes); Action a = () => result.Should() .BeFileContentResult() .WithFileContents(expectedBytes, Reason, ReasonArgs); a.Should().Throw <Exception>() .WithMessage(failureMessage); }