public void InvalidObjectReturnsInvalid() { // Arrange var cursusFile = new CursusFile(); // Act var result = cursusFile.IsValid(new DateTime()); // Assert Assert.AreEqual(false, result); }
public void NoFileReturnsInvalid() { // Arrange var cursusFile = new CursusFile(); // Act var result = cursusFile.IsValid(null); // Assert Assert.AreEqual(false, result); }
public void InvalidFileReturnsInvalid() { // Arrange var cursusFile = new CursusFile(); var formFile = new FormFile(null, 0, 0, "Excelfile", "Excelfile.xlsx"); // Act var result = cursusFile.IsValid(formFile); // Assert Assert.AreEqual(false, result); }
public void InvalidButEmptyFileReturnsInvalid() { // Arrange var cursusFile = new CursusFile(); byte[] fileContents = Encoding.UTF8.GetBytes("TestFile"); var formFile = new FormFile(new MemoryStream(fileContents), 0, 0, "TextFile", "TextFile.txt"); // Act var result = cursusFile.IsValid(formFile); // Assert Assert.AreEqual(false, result); }