コード例 #1
0
        public async void Register_Valid_User_Account(string personnummer, string name, double amount)
        {
            var output = Substitute.For <CustomPresenter <Application.UseCases.Register.RegisterOutput> >();

            var registerUseCase = new Application.UseCases.Register.RegisterInteractor(
                customerReadOnlyRepository,
                accountReadOnlyRepository,
                bus,
                output,
                converter
                );

            var request = new Application.UseCases.Register.RegisterInput(
                personnummer,
                name,
                amount
                );

            await registerUseCase.Process(request);

            Assert.Equal(request.PIN, output.Output.Customer.Personnummer);
            Assert.Equal(request.Name, output.Output.Customer.Name);
            Assert.True(Guid.Empty != output.Output.Customer.CustomerId);
            Assert.True(Guid.Empty != output.Output.Account.AccountId);
        }
コード例 #2
0
        public async void Register_Valid_User_Account(string personnummer, string name, double amount)
        {
            var output = Substitute.For <CustomPresenter <Application.UseCases.Register.RegisterResponse> >();

            var registerUseCase = new Application.UseCases.Register.RegisterInteractor(
                customerWriteOnlyRepository,
                output,
                converter
                );

            var request = new Application.UseCases.Register.RegisterCommand(
                personnummer,
                name,
                amount
                );

            await registerUseCase.Handle(request);

            Assert.Equal(request.PIN, output.Response.Customer.Personnummer);
            Assert.Equal(request.Name, output.Response.Customer.Name);
            Assert.True(Guid.Empty != output.Response.Customer.CustomerId);
            Assert.True(Guid.Empty != output.Response.Account.AccountId);
        }