コード例 #1
0
        public void SetUp()
        {
            exportHelper = Substitute.For <IExportHelper>();

            exportHelper.ToCsv(new List <string>()).ReturnsForAnyArgs(string.Empty);
            exportHelper.ToCsv(new List <string>()).ReturnsForAnyArgs(string.Empty);
            exportHelper.ToCsv(new List <string>()).ReturnsForAnyArgs(string.Empty);

            assembler     = new BillAssembler(exportHelper);
            validUsername = "******";
            validBillId   = Guid.NewGuid();
            validUserId   = Guid.NewGuid();

            validBillProxy = new BillProxy
            {
                Amount   = 10,
                Category = new CategoryProxy {
                    Id = Guid.NewGuid(), Name = "TEST"
                },
                CategoryId        = Guid.NewGuid(),
                Id                = Guid.NewGuid(),
                Name              = "TEST",
                ReoccurringPeriod = 1,
                StartDate         = DateTime.MaxValue,
                UserId            = Guid.NewGuid()
            };

            validGetBillResponse = new GetBillResponse {
                Bill = validBillProxy, RequestReference = Guid.NewGuid()
            };

            validBillViewModel = new BillViewModel
            {
                Amount            = 10,
                Category          = "TEST",
                Id                = Guid.NewGuid(),
                Name              = "TEST",
                ReoccurringPeriod = TimePeriod.Daily,
                StartDate         = DateTime.MinValue,
                UserId            = Guid.NewGuid()
            };

            validAddBillResponse = new AddBillResponse {
                Bill = validBillProxy, RequestReference = Guid.NewGuid()
            };

            validEditBillResponse = new EditBillResponse {
                Bill = validBillProxy, RequestReference = Guid.NewGuid()
            };

            validGetBillsForUserResponse = new GetBillsForUserResponse
            {
                Bills = new List <BillProxy> {
                    validBillProxy
                },
                RequestReference = Guid.NewGuid()
            };
        }
コード例 #2
0
        public void SetUp()
        {
            exportHelper = Substitute.For <IExportHelper>();

            exportHelper.ToCsv(new List <string>()).ReturnsForAnyArgs(string.Empty);
            exportHelper.ToJson(new List <string>()).ReturnsForAnyArgs(string.Empty);
            exportHelper.ToXml(new List <string>()).ReturnsForAnyArgs(string.Empty);

            assembler          = new ExpenditureAssembler(exportHelper);
            validUsername      = "******";
            validExpenditureId = Guid.NewGuid();
            validUserId        = Guid.NewGuid();

            validExpenditureProxy = new ExpenditureProxy
            {
                Amount   = 10,
                Category =
                    new CategoryProxy
                {
                    Id   = Guid.NewGuid(),
                    Name = "TEST"
                },
                CategoryId = Guid.NewGuid(),
                Id         = Guid.NewGuid(),
                UserId     = Guid.NewGuid()
            };

            validGetExpenditureResponse =
                new GetExpenditureResponse {
                Expenditure = validExpenditureProxy, RequestReference = Guid.NewGuid()
            };

            validExpenditureViewModel =
                new ExpenditureViewModel
            {
                Amount   = 10,
                Category = "TEST",
                Id       = Guid.NewGuid(),
                UserId   = Guid.NewGuid()
            };

            validAddExpenditureResponse =
                new AddExpenditureResponse {
                Expenditure = validExpenditureProxy, RequestReference = Guid.NewGuid()
            };

            validEditExpenditureResponse =
                new EditExpenditureResponse {
                Expenditure = validExpenditureProxy, RequestReference = Guid.NewGuid()
            };

            validGetExpenditureForUserResponse =
                new GetExpenditureForUserResponse
            {
                Expenditure =
                    new List <ExpenditureProxy> {
                    validExpenditureProxy
                },
                RequestReference = Guid.NewGuid()
            };

            validGetExpenditureForUserForMonthResponse =
                new GetExpenditureForUserForMonthResponse
            {
                Data =
                    new List <ExpenditureProxy> {
                    validExpenditureProxy
                }
            };
        }