2016-03-29 20 views
1

İlk kez birim testleri kullanmaya çalışıyor. Benim adım adım gidiyorum:Ünite testim her zaman beklemede

  1. Sağ Görsel stüdyoda test etmek istiyorum Projemin çözümünü tıkladım ve 'yeni bir proje' tıkladım. Sonra Test> Test Project'i seçtim. Bu, bir Test.cs dosyası ile çözümüm altında başka bir proje verdi. Ben ekledi kendisine şu:

    namespace TestProject1  
    { 
    [TestClass] 
    public class MainTest 
    { 
    
        //Project1.MainWindow mw = new Project1.MainWindow(); //not used in test yet 
    
        [TestMethod] 
        public void MakeDoubleDate_Test() 
        { 
         string validMpacString = "1998,265/302010"; //When converted, should be 36060.430902777778 
         string nonValidString1 = "nope,700/807060"; 
         string nonValidString2 = "thisDoesn't work"; 
    
         double validDouble = Project1.ConversionsUnit.MakeDoubleDate(validMpacString); 
         double nonValidDouble1 = Project1.ConversionsUnit.MakeDoubleDate(nonValidString1); 
         double nonValidDouble2 = Project1.ConversionsUnit.MakeDoubleDate(nonValidString2); 
    
         Assert.AreEqual(validDouble, 36060.430902777778); 
         Assert.AreEqual(nonValidDouble1, DateTime.Now.ToOADate()); 
         Assert.AreEqual(nonValidDouble2, DateTime.Now.ToOADate()); 
        } 
    } 
    

    }

Benim orijinal proje Project1 denir. Test projemde, Project1'a bir başvuru ekledim.

Şimdi, testüm test görünümünde görünüyor, ancak onu çalıştırmaya çalışmak sadece sonsuza dek beklemede kalıyor. Başka bir kişinin projesini test ettim ve aynı şeyi yaptı. Ne yapmam gerektiğinden emin değilim. Google etrafında herhangi bir şans snooping yoktu.

Düzenleme:

The thread 'ExecutionUtilities.InvokeWithTimeout helper thread 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.AbortTestRun'' (0x4748) has exited with code 0 (0x0). 
The thread 'Agent: adapter run thread for test 'MakeDoubleDate_Test' with id '1bc08c40-ee7f-46e5-8689-8237cd3ffe4b'' (0x2820) has exited with code 0 (0x0). 
The thread 'Agent: state execution thread for test 'MakeDoubleDate_Test' with id '1bc08c40-ee7f-46e5-8689-8237cd3ffe4b'' (0x1848) has exited with code 0 (0x0). 
The thread 'Agent: test queue thread' (0x3ecc) has exited with code 0 (0x0). 
W, 18160, 8, 2016/03/29, 12:52:54.995, USERNAME\QTAgent32.exe, AgentObject.AgentStateWaiting: Proceeding to clean up data collectors since connection to controller is lost 
The thread 'Agent: heartbeat thread' (0x4560) has exited with code 0 (0x0). 
The thread '<No Name>' (0x2284) has exited with code 0 (0x0). 
The thread '<No Name>' (0x4484) has exited with code 0 (0x0). 
The thread '<No Name>' (0x43f4) has exited with code 0 (0x0). 
The thread '<No Name>' (0x3a50) has exited with code 0 (0x0). 
The thread '<No Name>' (0x4424) has exited with code 0 (0x0). 

görsel stüdyo dışında ben çıkana kadar devam eder: İşte ben bunu denemenizi bazı ayıklama çıkışı var.

Düzenleme: Visual Studio 2010 ile ilgili bir şeyleri hizmet paketi ile ilgili sorunlar gördüm 1. Çıktığında ben yok. Şimdi güncelleniyor, umarım işe yarıyor.

+0

Genellikle bekleyen devlet inşa sırasında geçerli:

bu bağlantıdan bunu fikrim var. Çözüm oluşturmayı başarılı bir şekilde bitirir mi? – yonisha

+0

Evet! Hem ana proje hem de test projesini ayrı ayrı yeniden kurmayı denedim ve tüm bu çözüm başarılı oldu. Şu an sadece bir test var. – pfinferno

+0

Yayımla/bazı hata ayıklama bilgileriyle güncellendi. – pfinferno

cevap