public void LoadAllTestReturnsEmptyWhenDirectoryDoesNotExist() { const string uploadPath = @"C:\wwwroot\somepath\Upload"; using (MocksRecord()) { pathUtility.Expect(p => p.GetAbsolutePath("Upload")).Return(uploadPath); directory.Expect(d => d.Exists(uploadPath)).Return(false); } var expected = xmlFileService.LoadAll(); expected.Should().BeEmpty(); }