コード例 #1
0
        public void HourlyWageInfo_PublicProperties()
        {
            var workMeasurementFrequency = "workMeasurementFrequency";
            var numWorkers             = 5;
            var jobName                = "Job Name";
            var jobDescription         = "Job Description";
            var prevailingWageMethodId = 35;
            var prevailingWageMethod   = new Response {
                Id = prevailingWageMethodId
            };
            var mostRecentPrevailingWageSurvey = new PrevailingWageSurveyInfo();
            var alternateWageData      = new AlternateWageData();
            var scaWageDeterminationId = Guid.NewGuid().ToString();
            var scaWageDetermination   = new Attachment {
                Id = scaWageDeterminationId.ToString()
            };
            var attachmentId = Guid.NewGuid().ToString();
            var attachment   = new Attachment {
                Id = attachmentId.ToString()
            };

            var model = new HourlyWageInfo
            {
                WorkMeasurementFrequency = workMeasurementFrequency,
                NumWorkers                       = numWorkers,
                JobName                          = jobName,
                JobDescription                   = jobDescription,
                PrevailingWageMethodId           = prevailingWageMethodId,
                PrevailingWageMethod             = prevailingWageMethod,
                MostRecentPrevailingWageSurvey   = mostRecentPrevailingWageSurvey,
                AlternateWageData                = alternateWageData,
                SCAWageDeterminationAttachmentId = scaWageDeterminationId,
                SCAWageDeterminationAttachment   = scaWageDetermination,
                AttachmentId                     = attachmentId,
                Attachment                       = attachment
            };

            Assert.AreEqual(workMeasurementFrequency, model.WorkMeasurementFrequency);
            Assert.AreEqual(numWorkers, model.NumWorkers);
            Assert.AreEqual(jobName, model.JobName);
            Assert.AreEqual(jobDescription, model.JobDescription);
            Assert.AreEqual(prevailingWageMethodId, model.PrevailingWageMethodId);
            Assert.AreEqual(prevailingWageMethod, model.PrevailingWageMethod);
            Assert.AreEqual(mostRecentPrevailingWageSurvey, model.MostRecentPrevailingWageSurvey);
            Assert.AreEqual(alternateWageData, model.AlternateWageData);
            Assert.AreEqual(scaWageDeterminationId, model.SCAWageDeterminationAttachmentId);
            Assert.AreEqual(scaWageDetermination, model.SCAWageDeterminationAttachment);
            Assert.AreEqual(attachmentId, model.AttachmentId);
            Assert.AreEqual(attachment, model.Attachment);
        }
        public void Should_Require_AlternateWageData()
        {
            var model = new HourlyWageInfo {
                PrevailingWageMethodId = ResponseIds.PrevailingWageMethod.PrevailingWageSurvey, AlternateWageData = null
            };

            HourlyWageInfoValidator.ShouldNotHaveValidationErrorFor(x => x.AlternateWageData, model);
            model = new HourlyWageInfo {
                PrevailingWageMethodId = ResponseIds.PrevailingWageMethod.AlternateWageData, AlternateWageData = null
            };
            HourlyWageInfoValidator.ShouldHaveValidationErrorFor(x => x.AlternateWageData, model);
            model = new HourlyWageInfo {
                PrevailingWageMethodId = ResponseIds.PrevailingWageMethod.AlternateWageData, AlternateWageData = new AlternateWageData()
            };
            HourlyWageInfoValidator.ShouldNotHaveValidationErrorFor(x => x.AlternateWageData, model);
        }
コード例 #3
0
        public void Should_Require_SCAWageDeterminationId()
        {
            var model = new HourlyWageInfo {
                PrevailingWageMethodId = ResponseIds.PrevailingWageMethod.PrevailingWageSurvey, SCAWageDeterminationAttachmentId = null
            };

            HourlyWageInfoValidator.ShouldNotHaveValidationErrorFor(x => x.SCAWageDeterminationAttachmentId, model);
            model = new HourlyWageInfo {
                PrevailingWageMethodId = ResponseIds.PrevailingWageMethod.SCAWageDetermination, SCAWageDeterminationAttachmentId = null
            };
            HourlyWageInfoValidator.ShouldHaveValidationErrorFor(x => x.SCAWageDeterminationAttachmentId, model);
            model = new HourlyWageInfo {
                PrevailingWageMethodId = ResponseIds.PrevailingWageMethod.SCAWageDetermination, SCAWageDeterminationAttachmentId = Guid.NewGuid()
            };
            HourlyWageInfoValidator.ShouldNotHaveValidationErrorFor(x => x.SCAWageDeterminationAttachmentId, model);
        }
コード例 #4
0
        public ApplicationServiceMock()
        {
            _fileRepositoryMock       = new FileRepository(@"TestUploads\");
            _attachmentRepositoryMock = new AttachmentRepositoryMock();

            // Arrange
            var einToTest        = "41-9876543";
            var testFileContents = "test";
            var data             = Encoding.ASCII.GetBytes(testFileContents);

            using (var memoryStream = new MemoryStream(data))
            {
                var fileName = "test.txt";

                // Arrange
                var einToTest1 = "41-9876544";
                var fileName1  = "test1.txt";

                var einToTest2 = "41-9876545";
                var fileName2  = "test2.txt";

                var einToTest3 = "41-9876546";
                var fileName3  = "test3.txt";

                var einToTest4 = "41-9876547";
                var fileName4  = "test4.txt";

                var service       = new AttachmentService(_fileRepositoryMock, _attachmentRepositoryMock);
                var sCAAttachment = service.UploadAttachment(einToTest, memoryStream.ToArray(), fileName, "text/plain");
                var sCAWageDeterminationAttachment           = service.UploadAttachment(einToTest1, memoryStream.ToArray(), fileName1, "text/plain");
                var pieceRateWageInfoAttachment              = service.UploadAttachment(einToTest2, memoryStream.ToArray(), fileName2, "text/plain");
                var mostRecentPrevailingWageSurveyAttachment = service.UploadAttachment(einToTest3, memoryStream.ToArray(), fileName3, "text/plain");
                var hourlyWageInfoAttachment = service.UploadAttachment(einToTest4, memoryStream.ToArray(), fileName4, "text/plain");

                var address = new Section14c.Domain.Models.Address
                {
                    City          = "Test City",
                    County        = "Some County",
                    State         = "VA",
                    StreetAddress = "123 Main St",
                    ZipCode       = "12345"
                };
                var employerInfoProvidingFacilitiesDeductionType = new EmployerInfoProvidingFacilitiesDeductionType
                {
                    ProvidingFacilitiesDeductionType = new Response
                    {
                        Display = "Test"
                    }
                };
                ICollection <EmployerInfoProvidingFacilitiesDeductionType> eProvidingFacilitiesDeductionType =
                    new List <EmployerInfoProvidingFacilitiesDeductionType> {
                    employerInfoProvidingFacilitiesDeductionType
                };
                EmployerInfo employer = new EmployerInfo
                {
                    SCAAttachmentId    = "1234567890",
                    SCAAttachment      = sCAAttachment,
                    PhysicalAddress    = address,
                    TemporaryAuthority = true,
                    HasTradeName       = false,
                    ProvidingFacilitiesDeductionType = eProvidingFacilitiesDeductionType
                };
                SourceEmployer sEmployee = new SourceEmployer {
                    EmployerName = "Some Name"
                };
                ICollection <SourceEmployer> sourceEmployer = new List <SourceEmployer> {
                    sEmployee
                };
                PrevailingWageSurveyInfo prevailingWageSurveyInfo = new PrevailingWageSurveyInfo
                {
                    AttachmentId    = "1234567890",
                    Attachment      = mostRecentPrevailingWageSurveyAttachment,
                    SourceEmployers = sourceEmployer
                };
                PieceRateWageInfo pieceRateWageInfo = new PieceRateWageInfo
                {
                    AttachmentId = "1234567890",
                    Attachment   = pieceRateWageInfoAttachment,
                    SCAWageDeterminationAttachmentId = "1234567890",
                    SCAWageDeterminationAttachment   = sCAWageDeterminationAttachment,
                    MostRecentPrevailingWageSurvey   = prevailingWageSurveyInfo
                };
                HourlyWageInfo hourlyWageInfo = new HourlyWageInfo
                {
                    AttachmentId = "1234567890",
                    Attachment   = hourlyWageInfoAttachment,
                    MostRecentPrevailingWageSurvey = prevailingWageSurveyInfo,
                    SCAWageDeterminationAttachment = sCAWageDeterminationAttachment
                };
                Response res = new Response
                {
                    Display  = "Response Test 1",
                    IsActive = true
                };
                WIOAWorker worker1 = new WIOAWorker
                {
                    FullName           = "Test 1",
                    WIOAWorkerVerified = res,
                };
                ICollection <WIOAWorker> wIOAWorkerCol = null;
                wIOAWorkerCol = new List <WIOAWorker>()
                {
                    worker1
                };
                ICollection <Employee> employees = null;
                var emp = new Employee()
                {
                    AvgHourlyEarnings    = 1,
                    AvgWeeklyHours       = 1,
                    CommensurateWageRate = "1",
                    PrevailingWage       = 1,
                    Name              = "test",
                    NumJobs           = 1,
                    PrimaryDisability = new Response()
                    {
                        Display = "Sample Data"
                    },
                    ProductivityMeasure = 1.2,
                    TotalHours          = 1.0,
                    WorkType            = "Some Type"
                };
                employees = new List <Employee>()
                {
                    emp
                };
                ICollection <WorkSite> workSites = null;
                var ws = new WorkSite()
                {
                    Employees    = employees,
                    WorkSiteType = new Response()
                    {
                        Display = "Work Site Type"
                    },
                    Name = "This Is A Tribute",
                    SCA  = false
                };
                workSites = new List <WorkSite>()
                {
                    ws, ws, ws
                };

                WIOA wIOA = new WIOA
                {
                    WIOAWorkers = wIOAWorkerCol,
                };
                applicationSubmission = new ApplicationSubmission
                {
                    Employer          = employer,
                    PieceRateWageInfo = pieceRateWageInfo,
                    HourlyWageInfo    = hourlyWageInfo,
                    WIOA    = wIOA,
                    PayType = new Response()
                    {
                        Display = "Both"
                    },
                    WorkSites         = workSites,
                    EIN               = "11-1111111",
                    Id                = "CE7F5AA5-6832-43FE-BAE1-80D14CD8F666",
                    TotalNumWorkSites = 1,
                    ContactName       = "Tester",
                    ContactPhone      = "123=345-1234",
                    ContactEmail      = "*****@*****.**"
                };
                applicationSubmissionCollection = new List <ApplicationSubmission>();
                applicationSubmissionCollection.Add(applicationSubmission);
            }
        }
コード例 #5
0
        public void ApplicationSubmission_PublicProperties()
        {
            //Arrange
            var ein = "30-1234567";
            var applicationTypeId = 1;
            var applicationType   = new Response {
                Id = applicationTypeId
            };
            var hasPreviousApplication    = true;
            var hasPreviousCertificate    = true;
            var previousCertificateNumber = "xxxxxxx";
            var establishmentTypeId       = new List <int> {
                7, 8, 9
            };
            var contactName  = "Test Name";
            var contactPhone = "123-456-7890";
            var contactFax   = "123-456-7890";
            var contactEmail = "*****@*****.**";
            var employer     = new EmployerInfo();
            var payTypeId    = 21;
            var payType      = new Response {
                Id = payTypeId
            };
            var hourlyWageInfo    = new HourlyWageInfo();
            var pieceRateWageInfo = new PieceRateWageInfo();
            var totalNumWorkSites = 5;
            var workSites         = new List <WorkSite>();
            var wioa     = new WIOA();
            var statusId = 2;
            var status   = new Status {
                Id = statusId
            };
            var certificateEffectiveDate  = DateTime.Now;
            var certificateExpirationDate = DateTime.Now;
            var certificateNumber         = "xxxxxxxxxxxx";

            //Act
            var model = new ApplicationSubmission
            {
                EIN = ein,
                ApplicationTypeId         = applicationTypeId,
                ApplicationType           = applicationType,
                HasPreviousApplication    = hasPreviousApplication,
                HasPreviousCertificate    = hasPreviousCertificate,
                PreviousCertificateNumber = previousCertificateNumber,
                EstablishmentTypeId       = establishmentTypeId,
                ContactName       = contactName,
                ContactPhone      = contactPhone,
                ContactFax        = contactFax,
                ContactEmail      = contactEmail,
                Employer          = employer,
                PayTypeId         = payTypeId,
                PayType           = payType,
                HourlyWageInfo    = hourlyWageInfo,
                PieceRateWageInfo = pieceRateWageInfo,
                TotalNumWorkSites = totalNumWorkSites,
                WorkSites         = workSites,
                WIOA     = wioa,
                Status   = status,
                StatusId = statusId,
                CertificateEffectiveDate  = certificateEffectiveDate,
                CertificateExpirationDate = certificateExpirationDate,
                CertificateNumber         = certificateNumber
            };

            Assert.AreEqual(ein, model.EIN);
            Assert.AreEqual(applicationTypeId, model.ApplicationTypeId);
            Assert.AreEqual(applicationType, model.ApplicationType);
            Assert.AreEqual(hasPreviousApplication, model.HasPreviousApplication);
            Assert.AreEqual(hasPreviousCertificate, model.HasPreviousCertificate);
            Assert.AreEqual(previousCertificateNumber, model.PreviousCertificateNumber);
            Assert.AreEqual(establishmentTypeId[0], model.EstablishmentType.ElementAt(0).EstablishmentTypeId);
            Assert.AreEqual(establishmentTypeId[1], model.EstablishmentType.ElementAt(1).EstablishmentTypeId);
            Assert.AreEqual(establishmentTypeId[2], model.EstablishmentType.ElementAt(2).EstablishmentTypeId);
            Assert.AreEqual(contactName, model.ContactName);
            Assert.AreEqual(contactPhone, model.ContactPhone);
            Assert.AreEqual(contactFax, model.ContactFax);
            Assert.AreEqual(contactEmail, model.ContactEmail);
            Assert.AreEqual(employer, model.Employer);
            Assert.AreEqual(payTypeId, model.PayTypeId);
            Assert.AreEqual(payType, model.PayType);
            Assert.AreEqual(hourlyWageInfo, model.HourlyWageInfo);
            Assert.AreEqual(pieceRateWageInfo, model.PieceRateWageInfo);
            Assert.AreEqual(totalNumWorkSites, model.TotalNumWorkSites);
            Assert.AreEqual(workSites, model.WorkSites);
            Assert.AreEqual(wioa, model.WIOA);
            Assert.AreEqual(statusId, model.StatusId);
            Assert.AreEqual(status, model.Status);
            Assert.AreEqual(certificateEffectiveDate, model.CertificateEffectiveDate);
            Assert.AreEqual(certificateExpirationDate, model.CertificateExpirationDate);
            Assert.AreEqual(certificateNumber, model.CertificateNumber);
        }