Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich arbeite mich gerade in C# ein und hänge grad beim Erstellen von Testfällen.

Ich habe mir NUnit runtergeladen, die Datei entpackt und im Visual Studio unter Externe Tools eingefügt:

Titel: NUni

Befehl: C:\Users\...\NUnit-2.6.3\bin\nunit-x86.exe

Argumente: /run$(BinDir)$(TargetName)$(TargetExt)

Ausgangsverzeichnis: $(BinDir)

In meiner Projektmappe habe ich eine Klasse "Programm.cs" und eine Klasse "TestProgramm":


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using NUnit.Framework;


namespace ConsoleApplication1

{

    [TestFixture]

    class TestProgramm

    {

        [Test]

        public void testFaculty()

        {

            double result = Program.faculty(3);

            double expected = 108;

            Assert.AreEqual(expected,result);

        }


    }

}



Wähle ich im Menü Extras -> NUnit kommt die angehängt Fehlermeldung.

Was hab ich falsch gemacht? Und wie kriege ich das gefixt?

post-93782-1443044983313_thumb.png

  • Autor

Ok, es lag an nem fehlenden Leerzeichen nach "\run".

Meine Tests laufen jetzt, aber ich glaube, ich mache was verkehrt.

Wenn ich einen neuen Test hinzufüge, muss ich immer erst mein Programm kurz starten, damit der neue Test im NUnit auftaucht.

Ist das normal? Ich habe bisher nur mit Java/Eclipse gearbeitet und konnte dort Tests separat ausführen.

Wenn du eine Assembly (.exe, .dll) testest, musst du sie jedenfalls neu erstellen. Das macht Visual Studio beim Starten, falls nötig. Eclipse erstellt andauernd im Hintergrund, so weit ich weiß.

Du kannst anscheinend auch statt der Assembly die Projektdatei (.csproj) angeben. Möglicherweise erstellt NUnit die Assembly dann selbst.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.