public void Save_CheckDependency_DataBaseHandler_MethodeSaveCalled() { // arrange var dataBaseHandlerMock = A.Fake <IDataBaseHandler>(); var metaDataControl = new MetaDataControl(); var metadataItem = new MetadataItem(); metadataItem.Bezeichung = "Simon"; metadataItem.ValutaDatum = DateTime.Now; metadataItem.DokumentTyp = "Beleg"; metadataItem.Stichwoerter = "Test01"; // act metaDataControl.Save(metadataItem, "target", "guid", dataBaseHandlerMock); // assert A.CallTo(() => dataBaseHandlerMock.SaveData(metadataItem, "target\\guid_Metadata.xml")).MustHaveHappened(); }
public void Save_CheckIfMetadataItemValid_RetrunFalse() { // arrange var dataBaseHandlerStub = A.Fake <IDataBaseHandler>(); var metaDataControl = new MetaDataControl(); var metadataItem = new MetadataItem(true); metadataItem.Bezeichung = ""; metadataItem.ValutaDatum = DateTime.Now; metadataItem.DokumentTyp = "Beleg"; metadataItem.Stichwoerter = "Test01"; bool result; // act result = metaDataControl.Save(metadataItem, "target", "guid", dataBaseHandlerStub); // assert Assert.That(result, Is.False); }