XUnit.net Extensibility Brad Wilson Jim Newkirk. Schedule Assert Extensibility9:00 Before/After Extensibility9:45 Fact Extensibility10:15 BREAK10:45 Fixture.

Slides:



Advertisements
Similar presentations
Win8 on Intel Programming Course Desktop : WPF Cédric Andreolli Intel Software
Advertisements

Christian Hujer What is AceUnit? How does AceUnit work? How do I use AceUnit? © 2007 Christian Hujer.
Application Graphic design / svetagraphics.com 01 FRAMEWORK data service.
Automated Testing with Sitecore V2
J-Unit Framework.
MAHDI OMAR JUNIT TUTORIAL. CONTENTS Installation of Junit Eclipse support for Junit Using Junit exercise JUnit options Questions Links and Literature.
GoogleTest Primer. Outline Basic Concepts Assertions Basic Assertions Binary Comparison String Comparison Floating-Point Comparison Simple Tests Test.
1 OBJECTIVES To generate a web-based system enables to assemble model configurations. to submit these configurations on different.
Test Logging and Automated Failure Analysis Why Weak Automation Is Worse Than No Automation Geoff Staneff
Ch. 2 Exploring core JUnit. This chapter covers ■ Using the core JUnit classes ■ Understanding JUnit mechanisms ■ Understanding the JUnit lifecycle.
Objectives: Test Options JUnit Testing Framework TestRunners Test Cases and Test Suites Test Fixtures JUnit.
Generic API Test tool By Moshe Sapir Almog Masika Instructor Zvika Berkovic.
JUnit, Revisited 17-Apr-17.
U of R eXtensible Catalog Team MetaCat. Problem Domain.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
Automatic Software Testing Tool for Computer Networks ARD Presentation Adi Shachar Yaniv Cohen Dudi Patimer
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
© Dr. A. Williams, Fall Present Software Quality Assurance – JUnit Lab 1 JUnit A unit test framework for Java –Authors: Erich Gamma, Kent Beck Objective:
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Robot Framework – Basic Level. Date: Version:1.0 Page 1.
Computer Science and Engineering College of Engineering The Ohio State University JUnit The credit for these slides goes to Professor Paul Sivilotti at.
Building Search Portals With SP2013 Search. 2 SharePoint 2013 Search  Introduction  Changes in the Architecture  Result Sources  Query Rules/Result.
Python: An Introduction
Magnetic Field Measurement System as Part of a Software Family Jerzy M. Nogiec Joe DiMarco Fermilab.
.NET Framework Danish Sami UG Lead.NetFoundry
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Data Management Console Synonym Editor
Andrew S. Budarevsky Adaptive Application Data Management Overview.
XQuery Functions Reusing XQuery Code Date: September, 2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
(1) Unit Testing and Test Planning CS2110: SW Development Methods These slides design for use in lab. They supplement more complete slides used in lecture.
Introduction to JUnit 3.8 SEG 3203 Winter ‘07 Prepared By Samia Niamatullah.
SONIC-3: Creating Large Scale Installations & Deployments Andrew S. Neumann Principal Engineer, Progress Sonic.
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
SONIC-3: Creating Large Scale Installations & Deployments Andrew S. Neumann Principal Engineer Progress Sonic.
 Wes McClure  
JUnit Don Braffitt Updated: 10-Jun-2011.
ODS – Introduction to Web Services and BPEL Vakgroep Informatietechnologie Web Services & BPEL Design of Distributed Software.
S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
Google C++ Testing Framework Test Fixtures: Using the Same Data Configuration for Multiple Tests.
Unit, Regression, and Behavioral Testing Based On: Unit Testing with JUnit and CUnit by Beth Kirby Dec 13, 2002 Jules.
Test a Little, Code a Little Colin Sharples IBM Global Services New Zealand Colin Sharples IBM Global Services New Zealand.
JavaScript Functions. CSS Inheritance Which formatting applies? x y z input { display: block; } input.pref { background:red; } If you have a selector.
Session 7 Introduction to Inheritance. Accumulator Example a simple calculator app classes needed: –AdderApp - contains main –AddingFrame - GUI –CloseableFrame.
Justin Bare and Deric Pang with material from Erin Peach, Nick Carney, Vinod Rathnam, Alex Mariakakis, Krysta Yousoufian, Mike Ernst, Kellen Donohue Section.
THE EYESWEB PLATFORM - GDE The EyesWeb XMI multimodal platform GDE 5 March 2015.
1 PDMLink Application - User Features & Functions Module 6: Search Capabilities.
Topic: Junit Presenters: Govindaramanujam, Sama & Jansen, Erwin.
Robot Framework – Basic Level. Date: Version:1.0 Page 1.
Google C++ Testing Framework Part 2: Assertion. Concepts A test case contains one or many tests. ◦ You should group your tests into test cases that reflect.
Automated Testing with PHPUnit. How do you know your code works?
The Holmes Platform and Applications
Introducing the Microsoft® .NET Framework
Don Braffitt Updated: 26-Mar-2013
TESTING TEST DRIVEN DEVELOPMENT
How to link a test to a launcher (in this case a shell launcher)
Unit Testing with xUnit.net
Introduction to JUnit CS 4501 / 6501 Software Testing
More JUnit CS 4501 / 6501 Software Testing
An Automated Testing Framework
Selenium HP Web Test Tool Training
Unit Testing with xUnit.net-Part-2
Test-driven development (TDD)
Introduction to JUnit CS 4501 / 6501 Software Testing
More JUnit CS 4501 / 6501 Software Testing
Chapter 42 Web Services.
eSeries Entities By Julie Ladner
Presentation transcript:

xUnit.net Extensibility Brad Wilson Jim Newkirk

Schedule Assert Extensibility9:00 Before/After Extensibility9:45 Fact Extensibility10:15 BREAK10:45 Fixture Extensibility11:00 Runner Extensibility11:30 Putting it all Together11:45

Assert Extensibility

Not Easy to Add New Asserts  Limitations of the platform & language  Provide core assertions with the framework  Keep “assert language” consistent  No differentiation between failure and exceptions

Customization of Comparisons  IEquatable / IEqualityComparer  Assert.Contains  Assert.Equal  IComparable / IComparer  Assert.InRange  Fallback for Contains & Equal

Asserts that Return Values  When type is tested  Assert.IsAssignableFrom  Assert.IsType  Assert.Throws  When collections are tested  Assert.Single  Exception catcher  Record.Exception

Example Compare dates without times

Exercise Finish by 9:45

Before/After Extensibility

Design  Cross-cutting concerns  Reusable attribute  Initializing environment  Cleaning up after stateful tests  Runs regardless of test outcome  Has no access to test class or method  Unspecified order (compose for guarantee)

Example Rollback database

Brainstorming Exercise Finish by 10:15

Fact Extensibility

Design  Answers: “What is a test method?”  Enumeration of tests  Execution of tests  Metadata (skip, timeout, display name)

Why?  Metadata changes  “I want all my tests to have a timeout”  “I want the display name of my test to be something other than method name”  Enumeration changes  “I want this test method to be run many times, perhaps with different input values for each run”  Execution changes  “I want to do something different than just running the method with no parameters”

Example [Theory] attribute

Exercise Followed by break, back by 11:00

Fixture Extensibility

IUseFixture  Share reusable fixture setup and teardown  Constructor  Dispose  Most frameworks encourage base classes here  Lack of multiple inheritance in the CLR  “Inherit to be reused, not to reuse”

Example Test data seed & cleanup

ITestClassCommand and RunWith  Answers: “What is a test class?”  Pre- and post-fixture behavior  Pre- and post-test behavior  Test class creation & cleanup  Test method discovery  Test method ordering

Example Remove Randomization

Exercise Finish by 11:30

Runner Extensibility

Design  Version resilient runner APIs  Link against xunit.runner.utility.dll, not xunit.dll  Test assembly lives in a separate app domain  Assembly  Configuration File  (Optional) Shadow Copy

Low-Level API  Exector (remote)  ExecutorWrapper (local)  On the wire, it’s:  XML as a string (for status)  Boolean continue flag (to cancel)  Don’t use this.

High-Performance API  Thin wrapper on top of ExecutorWrapper  TestRunner  TestRunnerResult  IRunnerLogger  Cracks the XML into simple values  Not stateful; callback is mandatory  Runners: MSBuild, TD.NET, Resharper

Object-Oriented API  Object model on top of ExecutorWrapper  MultiAssemblyTestEnvironment  TestAssembly, TestClass, TestMethod  TestStatus  ITestMethodRunnerCallback  Cracks the XML into objects  Stateful; callback is optional  Runners: Console, GUI

Project files (.xunit)  One or more assemblies  Output types & locations  Filters

Example xunit.console

Putting it all Together

Example BDD with [Observation]

Example BDD with SubSpec

Example Amalga Best Practice Analyzer

Exercise

Thank @xunit