Esempio n. 1
0
        public void DellSoapProcessor_Given3BadTags_Gives0Responses()
        {
            WarrantyEngine.FetchTag(_invalidServiceTag);
            WarrantyEngine.FetchTag(_invalidServiceTag);
            WarrantyEngine.FetchTag(_invalidServiceTag);

            WarrantyEngine.dataTable.Rows.Count.Should().Be(0);
        }
Esempio n. 2
0
        public void DellSoapProcessor_Fetch_Stripswhitespace()
        {
            var firstTag  = "HPB7BQ1\r";
            var secondTag = "HPB7BQ1  ";

            WarrantyEngine.FetchTag(firstTag);
            WarrantyEngine.FetchTag(secondTag);
            WarrantyEngine.dataTable.Rows.Count.Should().Be(2);
        }
        private void fetchServiceTags()
        {
            var tasks = txtServiceTags.Text.Split('\n').Select(str => Task.Factory.StartNew((arg) =>
            {
                str = str.Trim();

                WarrantyEngine.FetchTag(str);

                Dispatcher.BeginInvoke(new queryDelegate(this.UpdateProgressBar), str);
            }, str)).ToList();

            pbarLow.Maximum = tasks.Count;

            Task.WaitAll(tasks.ToArray());
        }
Esempio n. 4
0
 public void DellSoapProcessor_ValidServiceTagResponse_IncludesPurchaseDate()
 {
     WarrantyEngine.FetchTag(_validServiceTag);
     WarrantyEngine.dataTable.Rows[0].ItemArray[2].ShouldBeEquivalentTo(DateTime.Parse("03/26/2012"));
 }
Esempio n. 5
0
 public void DellSoapProcessor_ValidServiceTagResponse_IncludesModel()
 {
     WarrantyEngine.FetchTag(_validServiceTag);
     WarrantyEngine.dataTable.Rows[0].ItemArray[1].Should().Be("Inspiron One 2320");
 }
Esempio n. 6
0
 public void DellSoapProcessor_GivenInvalidServiceTag_DoesNotGenerateResponse()
 {
     WarrantyEngine.FetchTag(_invalidServiceTag);
     WarrantyEngine.dataTable.Rows.Count.Should().Be(0);
 }
Esempio n. 7
0
 public void DellSoapProcessor_GivenServiceTag_GeneratesResponse()
 {
     WarrantyEngine.FetchTag(_validServiceTag);
     WarrantyEngine.dataTable.Rows.Count.Should().Be(1);
 }