Пример #1
0
        public void SetUpOrganisationTests()
        {
            var databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            var unitOfWork         = new UnitOfWork(databaseConnection);

            _repository           = new RegisterRepository(unitOfWork, new Mock <ILogger <RegisterRepository> >().Object);
            _validationRepository = new RegisterValidationRepository(unitOfWork);

            _organisationIdCreated = "EPA0987";
            _ukprnCreated          = 123321;
            _org2IdCreated         = "EPA0001";
            _organisationTypeId    = 5;
            OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel {
                Id = _organisationTypeId, Status = "new", Type = "organisation type 1"
            });
            _id = Guid.NewGuid();

            _organisation = new OrganisationModel
            {
                Id                             = _id,
                CreatedAt                      = DateTime.Now,
                EndPointAssessorName           = "name 2",
                EndPointAssessorOrganisationId = _organisationIdCreated,
                EndPointAssessorUkprn          = _ukprnCreated,
                PrimaryContact                 = null,
                OrganisationTypeId             = _organisationTypeId,
                OrganisationData               = null,
                Status                         = OrganisationStatus.New
            };

            _organisation2 = new OrganisationModel
            {
                Id                             = Guid.NewGuid(),
                CreatedAt                      = DateTime.Now,
                EndPointAssessorName           = "name 1",
                EndPointAssessorOrganisationId = _org2IdCreated,
                OrganisationTypeId             = null,
                Status                         = OrganisationStatus.New
            };

            _username = "******";
            OrganisationHandler.InsertRecord(_organisation);
            OrganisationHandler.InsertRecord(_organisation2);

            _contactId = Guid.NewGuid();

            _contact = new EpaContact
            {
                Id = _contactId,
                EndPointAssessorOrganisationId = _organisationIdCreated,
                Username    = _username,
                DisplayName = "Joe Cool",
                Email       = "*****@*****.**",
                PhoneNumber = "555 55555",
                Status      = OrganisationStatus.New,
                SigninType  = "",
                FirstName   = "zzz",
                LastName    = "Ftagn"
            };
        }
Пример #2
0
        public void SetUpOrganisationTests()
        {
            _repository            = new RegisterRepository(_databaseService.WebConfiguration, new Mock <ILogger <RegisterRepository> >().Object);
            _validationRepository  = new RegisterValidationRepository(_databaseService.WebConfiguration);
            _queryRepository       = new RegisterQueryRepository(_databaseService.WebConfiguration);
            _organisationIdCreated = "EPA0987";
            _ukprnCreated          = 123321;
            var org2IdCreated = "EPA0001";

            _organisationTypeId = 5;
            OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel {
                Id = _organisationTypeId, Status = "new", Type = "organisation type 1"
            });
            _id = Guid.NewGuid();

            _organisation = new EpaOrganisation
            {
                Id                 = _id,
                CreatedAt          = DateTime.Now,
                Name               = "name 2",
                OrganisationId     = _organisationIdCreated,
                Ukprn              = _ukprnCreated,
                PrimaryContact     = null,
                PrimaryContactName = null,
                Status             = OrganisationStatus.New,
                OrganisationTypeId = _organisationTypeId,
                OrganisationData   = new OrganisationData
                {
                    LegalName   = " legal name",
                    TradingName = "trading name",
                    Address1    = "address 1",
                    Address2    = "address 2",
                    Address3    = "address 3",
                    Address4    = "address 4",
                    Postcode    = "postcode"
                }
            };

            _organisation2 = new EpaOrganisation
            {
                Id                 = Guid.NewGuid(),
                Name               = "name 1",
                OrganisationId     = org2IdCreated,
                Status             = OrganisationStatus.New,
                OrganisationTypeId = null
            };
        }
        public void SetUpOrganisationTests()
        {
            var databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            var unitOfWork         = new UnitOfWork(databaseConnection);

            _validationRepository = new RegisterValidationRepository(unitOfWork);

            _organisationId1 = "EPA0088";
            _ukprn1          = 876533;
            _ukprn2          = 9888;

            _organisation1 = new OrganisationModel
            {
                Id                             = Guid.NewGuid(),
                CreatedAt                      = DateTime.Now.AddYears(-1).Date,
                DeletedAt                      = null,
                EndPointAssessorName           = "Name 1",
                EndPointAssessorOrganisationId = _organisationId1,
                EndPointAssessorUkprn          = _ukprn1,
                PrimaryContact                 = null,
                Status                         = "new",
                UpdatedAt                      = null,
                OrganisationTypeId             = null,
                OrganisationData               = null
            };

            _organisation2 = new OrganisationModel
            {
                Id                             = Guid.NewGuid(),
                CreatedAt                      = DateTime.Now.AddMonths(-1).Date,
                DeletedAt                      = null,
                EndPointAssessorName           = "Name 2",
                EndPointAssessorOrganisationId = "EPA0002",
                EndPointAssessorUkprn          = _ukprn2,
                PrimaryContact                 = null,
                Status                         = "new",
                UpdatedAt                      = null,
                OrganisationTypeId             = null,
                OrganisationData               = null
            };

            OrganisationHandler.InsertRecords(new List <OrganisationModel> {
                _organisation1, _organisation2
            });
        }
        public void SetUpOrganisationTests()
        {
            _repository            = new RegisterRepository(_databaseService.WebConfiguration, new Mock <ILogger <RegisterRepository> >().Object);
            _validationRepository  = new RegisterValidationRepository(_databaseService.WebConfiguration);
            _organisationIdCreated = "EPA0987";
            _organisationTypeId    = 5;
            OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel {
                Id = _organisationTypeId, Status = "new", Type = "organisation type 1"
            });
            _id = Guid.NewGuid();

            _organisation = new OrganisationModel
            {
                Id                             = _id,
                CreatedAt                      = DateTime.Now,
                EndPointAssessorName           = "name 2",
                EndPointAssessorOrganisationId = _organisationIdCreated,
                PrimaryContact                 = null,
                OrganisationTypeId             = _organisationTypeId,
                OrganisationData               = null,
                Status                         = OrganisationStatus.New
            };

            _username = "******";
            OrganisationHandler.InsertRecord(_organisation);
            _contactId    = Guid.NewGuid();
            _contactModel = new OrganisationContactModel
            {
                Id = _contactId,
                EndPointAssessorOrganisationId = _organisationIdCreated,
                OrganisationId = _id,
                Username       = _username,
                DisplayName    = "Joe Cool",
                Email          = "*****@*****.**",
                PhoneNumber    = "555 55555",
                Status         = OrganisationStatus.Live
            };

            _contactBeforeChange = new EpaContact
            {
                Id = _contactId,
                EndPointAssessorOrganisationId = _organisationIdCreated,
                Username    = _username,
                DisplayName = "Joe Cool",
                Email       = "*****@*****.**",
                PhoneNumber = "555 55555",
                Status      = OrganisationStatus.Live
            };

            _contactUpdated = new EpaContact
            {
                Id = _contactId,
                EndPointAssessorOrganisationId = _organisationIdCreated,
                Username    = _username,
                DisplayName = "Joe Cool changes",
                Email       = "*****@*****.**",
                PhoneNumber = "555 44444",
                Status      = OrganisationStatus.Live
            };
            OrganisationContactHandler.InsertRecord(_contactModel);
        }