コード例 #1
0
        public string Transfer(
            Account debitAccount,
            Account creditAccount,
            decimal amount,
            string motif
            )
        {
            MGuid.NewGuid = () => new Guid("64d80a10-4f21-4acb-9d3d-0332e68c4394");

            PexAssume.IsNotNull(debitAccount);
            PexAssume.IsNotNull(creditAccount);
            PexAssume.IsTrue(creditAccount != debitAccount);
            var repository          = new SIRepository();
            var operationRepository = new SIOperationRepository();
            var operationCreator    = new OperationDtoCreator();

            //act
            var operationServices = new OperationServices(operationRepository, repository, operationCreator);

            operationServices.Transfer(debitAccount, creditAccount, amount, motif);

            string result = operationServices.Transfer(debitAccount, creditAccount, amount, motif);

            PexAssert.IsNotNullOrEmpty(result);
            return(result);
        }