Example #1
0
        public int Insert(OrganisationsNeedingVolunteers data)
        {
            _dbContext.OrganisationsNeedingVolunteers.Add(data);
            int response = _dbContext.SaveChanges();

            return(data.Id);
        }
Example #2
0
        public void GivenAValidRequestItCanAddRecordToDB()
        {
            var data = new OrganisationsNeedingVolunteers();

            _fakeValidator.Setup(p => p.Validate(data)).Returns(new Dictionary <string, string>());
            _classUnderTest.InsertOrganisationVolunteerRecord(data);
            _fakeGateway.Verify(m => m.Insert(data), Times.Once);
        }
Example #3
0
        public void CanCallTheRequestValidationMethod()
        {
            var data = new OrganisationsNeedingVolunteers();

            _fakeGateway.Setup(p => p.Insert(data));
            _fakeValidator.Setup(p => p.Validate(data)).Returns(new Dictionary <string, string>());
            _classUnderTest.InsertOrganisationVolunteerRecord(data);
            _fakeValidator.Verify(m => m.Validate(data), Times.Once);
        }
Example #4
0
        public Dictionary <string, string> Validate(OrganisationsNeedingVolunteers data)
        {
            Dictionary <string, string> validationResponse = new Dictionary <string, string>();

            return(validationResponse);
        }