private void getStatusButton_Click(object sender, RoutedEventArgs e)
 {
     var queryInvoker = new QueryInvoker(
         new SubmissionDataService(
             new Lrap1SubmissionRepository(),
             new Lrap1AttachmentRepository()));
     var result = queryInvoker.Query<Lrap1StatusQuery,Lrap1StatusQueryResult>(new Lrap1StatusQuery() {ApplicationId = applicationIdTextBox.Text});
     MessageBox.Show("Application Status: " + result.ResponseType.ToString(), "Status", MessageBoxButton.OK);
 }
Ejemplo n.º 2
0
        private void getStatusButton_Click(object sender, RoutedEventArgs e)
        {
            var queryInvoker = new QueryInvoker(
                new SubmissionDataService(
                    new Lrap1SubmissionRepository(),
                    new Lrap1AttachmentRepository()));
            var result = queryInvoker.Query <Lrap1StatusQuery, Lrap1StatusQueryResult>(new Lrap1StatusQuery()
            {
                ApplicationId = applicationIdTextBox.Text
            });

            MessageBox.Show("Application Status: " + result.ResponseType.ToString(), "Status", MessageBoxButton.OK);
        }
Ejemplo n.º 3
0
        public WhenUserRequestsCreateContactForm()
        {
            var countyRepository = Mock.Of<ICountyRepository>();
            var countryRepository = Mock.Of<ICountryRepository>();

            var queryInvoker = new QueryInvoker(new ContactService(countyRepository,
                countryRepository,
                null,
                new ValidationService(),
                new ContactAdministrationService(countyRepository,
                    countryRepository,
                    null)));

            Mock.Get(countyRepository).Setup(q => q.GetAll()).Returns(_counties);
            Mock.Get(countryRepository).Setup(q => q.GetAll()).Returns(_countries);

            _createContactResult = queryInvoker.Query<CreateContactQueryResult>();
        }
Ejemplo n.º 4
0
        public void the_current_status_of_the_submission_is_returned()
        {
            //Arrange
            var fakeLrap1Repository = A.Fake <ILrap1SubmissionRepository>();
            var sut          = new SubmissionDataService(fakeLrap1Repository, null);
            var queryInvoker = new QueryInvoker(sut);

            A.CallTo(() => fakeLrap1Repository.GetById(A <string> .Ignored))
            .Returns(new Lrap1Submission()
            {
                ResponseType = ResponseType.Acknowledgment
            });

            //Act
            var query = new Lrap1StatusQuery()
            {
                ApplicationId = "123456890"
            };

            var result = queryInvoker.Query <Lrap1StatusQuery, Lrap1StatusQueryResult>(query);

            //Assert
            Assert.Equal(ResponseType.Acknowledgment, result.ResponseType);
        }
Ejemplo n.º 5
0
        public WhenUserRequestsUpdateContactForm()
        {
            var contactRepository = Mock.Of<IContactRepository>();

            Mock.Get(contactRepository)
                .Setup(q => q.GetById(1))
                .Returns(new Contact(new CreateContactCommand
                {
                    FirstName = "Bob",
                    Surname = "Holness",
                    Address1 = "1 Blockbuster way",
                    Address2 = "ITV Town",
                })
                {
                    County = new County(1, "Some County"),
                    Country = new Country(2, "UK"),
                });

            var countyRepository = Mock.Of<ICountyRepository>();
            var countryRepository = Mock.Of<ICountryRepository>();

            var queryInvoker = new QueryInvoker(new ContactService(countyRepository,
                countryRepository,
                contactRepository,
                new ValidationService(),
                new ContactAdministrationService(countyRepository,
                    countryRepository,
                    contactRepository)));

            Mock.Get(countyRepository).Setup(q => q.GetAll()).Returns(_counties);
            Mock.Get(countryRepository).Setup(q => q.GetAll()).Returns(_countries);

            _queryResult =
                queryInvoker.Query<UpdateContactQuery, UpdateContactQueryResult>(new UpdateContactQuery {Id = 1});
        }
        public void the_current_status_of_the_submission_is_returned()
        {
            //Arrange
            var fakeLrap1Repository = A.Fake<ILrap1SubmissionRepository>();
            var sut = new SubmissionDataService(fakeLrap1Repository, null);
            var queryInvoker = new QueryInvoker(sut);

            A.CallTo(() => fakeLrap1Repository.GetById(A<string>.Ignored))
                .Returns(new Lrap1Submission() {ResponseType = ResponseType.Acknowledgment});

            //Act
            var query = new Lrap1StatusQuery()
            {
                ApplicationId = "123456890"
            };

            var result = queryInvoker.Query<Lrap1StatusQuery, Lrap1StatusQueryResult>(query);

            //Assert
            Assert.Equal(ResponseType.Acknowledgment, result.ResponseType);
        }