コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }