public void WriteProjectInfoFile_Execute_WhenNotCSharpWithNullCodePage_ExpectsNull() { // Arrange decimal?codePage = null; var encodingProvider = new TestEncodingProvider( x => { Assert.Fail("should not have been called"); throw new InvalidOperationException(); }, x => { Assert.Fail("should not have been called"); throw new InvalidOperationException(); }); // Act var actual = WriteProjectInfoFile_ExecuteAndReturn(encodingProvider, codePage, "whatever", "foo9"); // Assert Assert.AreEqual(null, actual.Encoding, "unexpected encoding"); }
public void WriteProjectInfoFile_Execute_WhenNotCSharpVBNetWithInferiorToZeroCodePage_ExpectsNull() { // Arrange const decimal codePage = -1; var encodingProvider = new TestEncodingProvider( x => { Assert.Fail("should not have been called"); throw new InvalidOperationException(); }, x => { Assert.Fail("should not have been called"); throw new InvalidOperationException(); }); // Act var actual = WriteProjectInfoFile_ExecuteAndReturn(encodingProvider, codePage, "whatever", "foo10"); // Assert actual.Encoding.Should().BeNull("unexpected encoding"); }
public void WriteProjectInfoFile_Execute_WhenNotCSharpVBNetWithBiggerThanLongCodePage_ExpectsNull() { // Arrange var encodingProvider = new TestEncodingProvider( x => { Assert.Fail("should not have been called"); throw new InvalidOperationException(); }, x => { Assert.Fail("should not have been called"); throw new InvalidOperationException(); }); var codePage = (decimal)long.MaxValue + 1; // Act var actual = WriteProjectInfoFile_ExecuteAndReturn(encodingProvider, codePage, "whatever", "foo11"); // Assert Assert.AreEqual(null, actual.Encoding, "unexpected encoding"); }