Beispiel #1
0
 public static IDocument FindDocument(this IDocumentManagerService service, object parameter, object parentViewModel)
 {
     VerifyService(service);
     return(service.GetDocumentsByParentViewModel(parentViewModel).FirstOrDefault(d => {
         var supportParameter = d.Content as ISupportParameter;
         return supportParameter != null && object.Equals(supportParameter.Parameter, parameter);
     }));
 }
        public void NullService()
        {
            IDocumentManagerService service = null;
            IDocument newDocument           = null;

            Assert.Throws <ArgumentNullException>(() => { service.CreateDocumentIfNotExistsAndShow(ref newDocument, "Type", "X", "Y", "title"); });
            Assert.Throws <ArgumentNullException>(() => { service.CreateDocument(new TestViewModel()); });
            Assert.Throws <ArgumentNullException>(() => { service.FindDocument("X", "Y"); });
            Assert.Throws <ArgumentNullException>(() => { service.GetDocumentsByParentViewModel("X"); });
        }
Beispiel #3
0
        public void NullService_GetDocumentsByParentViewModel()
        {
            IDocumentManagerService service = null;

            service.GetDocumentsByParentViewModel("X");
        }