Example #1
0
        public void TestCreateUser()
        {
            var repository = new InMemoryUserRepository();
            var presenter  = new UserCreateCollector();
            var interactor = CreateInteractor(repository, presenter);
            var request    = new UserCreateRequest("TestUser");

            interactor.Handle(request);

            var expectedPercentages = new List <int> {
                10,
                30,
                50,
                80
            };

            Assert.IsTrue(expectedPercentages.SequenceEqual(presenter.Percentages));
            Assert.IsNotNull(presenter.Response);
            Assert.IsNotNull(presenter.Response.UserId);
            var inserted = repository.FindByUserName("TestUser");

            Assert.IsNotNull(inserted);
        }