NUnit

NUnit
Логотип программы NUnit
Скриншот программы NUnit
Графическая среда NUnit 2.4.6 под Windows
Тип Система автоматизированного тестирования
Разработчики Чарли Пул и другие
Написана на C#
Операционные системы Все, поддерживаемые Microsoft .NET или Mono
Последняя версия 4.1.0 (25 февраля 2024[1])
Репозиторий github.com/nunit/nunit
Лицензия MIT
Сайт nunit.org

NUnit — открытая среда юнит-тестирования приложений для .NET. Она была портирована с языка Java (библиотека JUnit). Первые версии NUnit были написаны на J#, но затем весь код был переписан на C# с использованием таких новшеств .NET, как атрибуты.

Существуют также известные расширения оригинального пакета NUnit, большая часть из них также с открытым исходным кодом. NUnit.Forms дополняет NUnit средствами тестирования элементов пользовательского интерфейса Windows Forms. NUnit.ASP выполняет ту же задачу для элементов интерфейса в ASP.NET.

Примечания

  1. NUnit - Downloads. Дата обращения: 27 мая 2024. Архивировано 8 мая 2024 года.

Пример

Пример теста NUnit:

using NUnit.Framework;
 
[TestFixture]
public class ExampleTestOfNUnit
{
    [Test]
    public void TestMultiplication()
    {
        Assert.AreEqual(6, 3 * 2, "Умножение");
    }
}

NUnit автоматически находит метод ExampleTestOfNUnit.TestMultiplication() с помощью отражения (рефлексии)

Литература

  • Эндрю Хант, Дэвид Томас: Pragmatic Unit Testing in C# with NUnit (Прагматичное тестирование на C# с помощью NUnit). The Pragmatic Bookshelf, Raleigh 2004, ISBN 0-9745140-2-0
  • Джим Ньюкирк, Алексей Воронцов: Test-Driven Development in Microsoft .NET. (Разработка через тестирование — с Microsoft.NET). Microsoft Press, Redmond 2004, ISBN 0-7356-1948-4
  • Билл Хамильтон: NUnit Pocket Reference (Карманный справочник по NUnit). O'Reilly, Cambridge 2004, ISBN 0-596-00739-6
  • Кристиан Нейгел, Билл Ивьен, Джей Глинн, Карли Уотсон, Морган Скиннер. C# 2005 и платформа .NET 3.0 для профессионалов = Professional C# 2005 with .NET 3.0. — М.: «Диалектика», 2007. — ISBN 978-5-8459-1317-3.

См. также

Ссылки


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.