public void SharePointDocumentInfo_AddDocument_Success() { // Arrange var folder = new SharePointDocumentInfo(0, "Folder", null, false); // Act folder.AddDocument(new SharePointDocumentInfo(1, "File1.txt", null, true)); // Assert folder.Documents.Count.Should().Be(1); }
public void SharePointDocumentInfo_AddDocuments_Success() { // Arrange var folder = new SharePointDocumentInfo(0, "Folder", null, false); // Act folder.AddDocuments(new List <SharePointDocumentInfo>() { new SharePointDocumentInfo(1, "File1.txt", null, true), new SharePointDocumentInfo(2, "File2.txt", null, true) }); // Assert folder.Documents.Count.Should().Be(2); }
public void SharePointDocumentInfo_AddDocument_OnlyFoldersCanReceiveDocuments() { // Arrange var document = new SharePointDocumentInfo(1, "File1.txt", null, true); // Act var exception = Assert.Throws <SharePointException>(() => { document.AddDocument(new SharePointDocumentInfo(1, "File1.txt", null, true)); }); // Assert exception.Message.Should().Be(SharePointMessages.ERR402); exception.ErrorCode.Should().Be(SharePointErrorCode.OnlyFoldersCanReceiveDocuments); }
public void SharePointDocumentInfo_AddDocuments_OnlyFoldersCanReceiveDocuments() { // Arrange var folder = new SharePointDocumentInfo(0, "Folder", null, true); // Act var exception = Assert.Throws <SharePointException>(() => { folder.AddDocuments(new List <SharePointDocumentInfo>() { new SharePointDocumentInfo(1, "File1.txt", null, true), new SharePointDocumentInfo(2, "File2.txt", null, true) }); }); // Assert exception.Message.Should().Be(SharePointMessages.ERR402); exception.ErrorCode.Should().Be(SharePointErrorCode.OnlyFoldersCanReceiveDocuments); }