QA your code: The new Unity Test Framework – Unite Copenhagen 2019Unity Technologies
Are you involved in testing or QA on projects in Unity? In these slides, you'll get an overview of the state of Unity for all things testing-related, and have the opportunity to share your stories of success, failure, pain, and glory. Learn from your fellow developers and give feedback on how Unity could help you hold your projects to a higher standard of quality. You will also get an introduction to the newest features in the Test Framework.
Speakers:
Christian Warnecke - Unity
Richard Fine - Unity
Watch the session on YouTube: https://youtu.be/wTiF2D0_vKA
Training material for coaching using GTD with Outlook. This material is not affiliated with, or endorsed, approved or authorized by, Microsoft Corporation or The David Allen Company but everyone who attends the course discovers that can be more productive with a minimum effort
QA your code: The new Unity Test Framework – Unite Copenhagen 2019Unity Technologies
Are you involved in testing or QA on projects in Unity? In these slides, you'll get an overview of the state of Unity for all things testing-related, and have the opportunity to share your stories of success, failure, pain, and glory. Learn from your fellow developers and give feedback on how Unity could help you hold your projects to a higher standard of quality. You will also get an introduction to the newest features in the Test Framework.
Speakers:
Christian Warnecke - Unity
Richard Fine - Unity
Watch the session on YouTube: https://youtu.be/wTiF2D0_vKA
Training material for coaching using GTD with Outlook. This material is not affiliated with, or endorsed, approved or authorized by, Microsoft Corporation or The David Allen Company but everyone who attends the course discovers that can be more productive with a minimum effort
Learn how to set up an end-to-end testing framework Cypress Automation Testing Tutorial in an angular app. Also, visit the Github code to set up the project.
Hamcrest is a library for creating matchers for usage in unit tests, mocks and UI validation. This talk gives a brief introduction to using and writing Hamcrest matchers.
The topics covered:
* Basic introduction to Hamcrest
* Using Matchers in assertions
* Using Matchers with Mockito
* Writing custom matchers
* Ad-hoc matchers
5-minute intro to Stetl an Open Source lightweight framework for handling the conversion and transformation (ETL) of in particular complex/rich GML. Stetl uses and combines existing tools like GDAL/OGR and XSLT. Python is used as glue. Users configure an ETL-process chain through a configuration.
More at http://stetl.org
Implementing generic JNI hardware control for Kotlin based app on AOSPCheng Wig
With the popularity of Android phones, along with the success in the consumer field, the industrial Android platform is getting more and more popular in Europe.
An industrial grade Android OS usually requires hardware control such as GPIO, I2C, PWM, etc., however device vendors implement these functions in different ways, some may even compromise Android security function. In this session, the presenter will introduce how to implement packaged JNI API from common libraries of Linux OS for hardware controlling for Kotlin based app while fully matching the security architecture of Android OS through AOSP 12 BSP and Android-Studio IDE.
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Simplilearn
This presentation about Selenium IDE for beginners will help you learn about the new Selenium IDE, its working principle, components, key features, and limitations. Selenium is an automated testing tool that tests web applications across various platforms and browsers. Selenium IDE happens to be one of the Selenium tools with a simple working principle. Selenium IDE ceased to exist in 2017 and an updated version released recently. It records the user interactions with the browser and replays the same to find bugs/errors. Many advancements with the new version have made IDE flexible and robust. Now, let us get started and understand what the new Selenium IDE has got to offer us.
In this presentation, we will be covering the following:
1. What is Selenium?
2. What is Selenium IDE?
3. Advancements with new IDE
4. Working principle of Selenium IDE
5. Components of Selenium IDE
6. Selenium commands
7. Key features of Selenium IDE
8. Limitations of Selenium IDE
Selenium training has been designed to help developers and manual testers learn how to automate web applications with a robust framework, and integrate it within the DevOps processes of an organization. The course contains a lot of real-life examples and situations to demonstrate how to use Selenium WebDriver effectively.
What are the objectives of this Selenium training course?
This course will enable you to:
1. Revise the core Java concepts which are essential for learning Selenium WebDriver
2. Understand the scope of Test Automation in DevOps and fundamentals of Test Automation
3. Create Test Cases using Selenium IDE – Record and Playback tool
4. Understand Selenium WebDriver architecture and various layers of interaction
5. Set up WebDriver project in Eclipse and write test cases using TestNG
6. Locate elements using various locating techniques
7. Work with various WebDriver commands to drive web browser and various WebElement commands to deal with various web components
8. Learn to deal with various possible scenarios in terms of pop-ups, multiple Windows, frames, taking screenshots
9. Implement Page Object Design Pattern and Data Driven Testing
10. Understand how to use Maven, ANT, AutoIT, Sikuli, log4j, and listeners
11. Learn to use Selenium Grid with TestNG for parallel execution
12. Execute a project from scratch by building automation framework and automating a few test scenarios
Who should take this Selenium training course?
The course is ideal for :
1. Test Managers
2. Test Engineers
3. Test Lead
4. Test Analyst
5. QA Engineers
6. Software Developers
7. Engineers who want to learn Automation testing
Learn more at https://www.simplilearn.com/selenium-certification-training
Beginners - Get Started With Unit Testing in .NETBaskar K
Beginners - Get started with unit testing in .NET. Introduction to unit testing and mocking.. List of unit testing frameworks available in .NET - NUnit, xUnit.net, Visual Studio unit test framework. List of mocking frameworks available in .NET - Moq, Rhino Mocks, FakeItEasy, NSubstitue, JustMock, and TypeMock. Introduction to Visual Studio Unit Testing Framework, NUnit and xUnit.net.
Learn how to set up an end-to-end testing framework Cypress Automation Testing Tutorial in an angular app. Also, visit the Github code to set up the project.
Hamcrest is a library for creating matchers for usage in unit tests, mocks and UI validation. This talk gives a brief introduction to using and writing Hamcrest matchers.
The topics covered:
* Basic introduction to Hamcrest
* Using Matchers in assertions
* Using Matchers with Mockito
* Writing custom matchers
* Ad-hoc matchers
5-minute intro to Stetl an Open Source lightweight framework for handling the conversion and transformation (ETL) of in particular complex/rich GML. Stetl uses and combines existing tools like GDAL/OGR and XSLT. Python is used as glue. Users configure an ETL-process chain through a configuration.
More at http://stetl.org
Implementing generic JNI hardware control for Kotlin based app on AOSPCheng Wig
With the popularity of Android phones, along with the success in the consumer field, the industrial Android platform is getting more and more popular in Europe.
An industrial grade Android OS usually requires hardware control such as GPIO, I2C, PWM, etc., however device vendors implement these functions in different ways, some may even compromise Android security function. In this session, the presenter will introduce how to implement packaged JNI API from common libraries of Linux OS for hardware controlling for Kotlin based app while fully matching the security architecture of Android OS through AOSP 12 BSP and Android-Studio IDE.
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Simplilearn
This presentation about Selenium IDE for beginners will help you learn about the new Selenium IDE, its working principle, components, key features, and limitations. Selenium is an automated testing tool that tests web applications across various platforms and browsers. Selenium IDE happens to be one of the Selenium tools with a simple working principle. Selenium IDE ceased to exist in 2017 and an updated version released recently. It records the user interactions with the browser and replays the same to find bugs/errors. Many advancements with the new version have made IDE flexible and robust. Now, let us get started and understand what the new Selenium IDE has got to offer us.
In this presentation, we will be covering the following:
1. What is Selenium?
2. What is Selenium IDE?
3. Advancements with new IDE
4. Working principle of Selenium IDE
5. Components of Selenium IDE
6. Selenium commands
7. Key features of Selenium IDE
8. Limitations of Selenium IDE
Selenium training has been designed to help developers and manual testers learn how to automate web applications with a robust framework, and integrate it within the DevOps processes of an organization. The course contains a lot of real-life examples and situations to demonstrate how to use Selenium WebDriver effectively.
What are the objectives of this Selenium training course?
This course will enable you to:
1. Revise the core Java concepts which are essential for learning Selenium WebDriver
2. Understand the scope of Test Automation in DevOps and fundamentals of Test Automation
3. Create Test Cases using Selenium IDE – Record and Playback tool
4. Understand Selenium WebDriver architecture and various layers of interaction
5. Set up WebDriver project in Eclipse and write test cases using TestNG
6. Locate elements using various locating techniques
7. Work with various WebDriver commands to drive web browser and various WebElement commands to deal with various web components
8. Learn to deal with various possible scenarios in terms of pop-ups, multiple Windows, frames, taking screenshots
9. Implement Page Object Design Pattern and Data Driven Testing
10. Understand how to use Maven, ANT, AutoIT, Sikuli, log4j, and listeners
11. Learn to use Selenium Grid with TestNG for parallel execution
12. Execute a project from scratch by building automation framework and automating a few test scenarios
Who should take this Selenium training course?
The course is ideal for :
1. Test Managers
2. Test Engineers
3. Test Lead
4. Test Analyst
5. QA Engineers
6. Software Developers
7. Engineers who want to learn Automation testing
Learn more at https://www.simplilearn.com/selenium-certification-training
Beginners - Get Started With Unit Testing in .NETBaskar K
Beginners - Get started with unit testing in .NET. Introduction to unit testing and mocking.. List of unit testing frameworks available in .NET - NUnit, xUnit.net, Visual Studio unit test framework. List of mocking frameworks available in .NET - Moq, Rhino Mocks, FakeItEasy, NSubstitue, JustMock, and TypeMock. Introduction to Visual Studio Unit Testing Framework, NUnit and xUnit.net.
This slide explain you the concept of XUnit with Asp.Net Core Web API. This slide covers,
Understanding Testing of Application,
Unit testing with XUnit Framework to improve the software performance,
Explains how to start with Unit and Integration testing with XUnit.
Test Driven Development, or TDD, is the mainstream in many areas of software development, but what about the database? In this session, we explore TDD, the benefits of automated testing, and how testing data projects differs from other types of development. We introduce the tSQLt testing framework and demonstrate its use with a live coding example. Finally, we will discuss some lessons learned in doing TDD with SQL Server.
Originally presented by Steve Fibich and David Moore at Richmond SQL Server Users Group on January 11, 2018
Unit Testing in .NET Core 7.0 with XUnit.pptxKnoldus Inc.
Join us for an insightful session on xUnit testing in the latest .NET 7.0 environment! In this workshop, we'll delve into the powerful xUnit testing framework, a widely adopted tool for crafting robust and efficient unit tests in the .NET ecosystem. Learn how xUnit seamlessly integrates with the latest features of .NET 7.0, providing developers with an unparalleled testing experience. We'll cover the fundamentals of writing clear and concise unit tests using xUnit syntax, explore advanced features for more complex scenarios, and discuss best practices for maintaining a scalable and reliable test suite. Whether you're a seasoned developer or new to testing in .NET, this session will equip you with the knowledge and skills to leverage xUnit effectively in your projects. Don't miss this opportunity to elevate your testing game and ensure the resilience of your .NET 7.0 applications.
In this session, we will introduce you to the concept of unit testing and how we can add new features to our application without breaking anything. We will see how we can add unit test cases for each of our components and the importance of it.
JUnit: A unit testing framework that is extensively used to test the code written in Java.
Unit testing is a type of software testing.
Software testing: The process of examining whether the software and its components meet the specified requirements
Other types of software testing are as shown.
● What is Unit Testing?
● Benefits
● What is Test Driven Development?
● What is Behavior Driven Development?
● Categories of (Unit) Tests / Software Testing
Pyramid, Frameworks
● C++, Java, .NET, Perl, PHP frameworks
● Unit-testing Zend Framework application
Software testing
Developers Belief on Software Testing
Developers Responsibility for testing
Test writing methods
State based testing
Behavioural/interaction based testing
Writing a Testable Code
Flaw 1 - Constructor does Real Work
Flaw 2 - API lies about it's real dependencies
Flaw 3 - Brittle Global State & Singletons
Testing Frameworks and tools for Java...
Mockito and PowerMock...
Testing Models
Stubs Based Testing Model
Mocked Objects Based Testing Model
JUit 4.+ and TestNG
https://www.adroitlogic.com
https://developer.adroitlogic.com
This was a workshop given on the UTN University, for the Software Engineering students. The idea is to give a brief explanation about TDD, and how to use it.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
2. • Forces to write better software architecture
• Makes sure the logic of the methods are working
as they should
• Refactoring and maintaining the codebase is
easier and you’ll have more confidence. No need
to be scared of making changes and improving
the software.
• Find bugs early before even running the software
• Works as up-to-date documentation how the
software and it’s public API should be used
• TDD (Test Driven Development) helps you design
the business logic of your code by breaking it
down into smaller objectives
WHY BOTHER WITH UNIT TESTS?
3. GETTING STARTED
• Unity uses NUnit testing framework.
https://github.com/nunit/docs/wiki/NUnit-Docum
entation
• Open up the Unity Test Runner window in
Window - General - Test Runner and then press
Create PlayMode Test Assembly Folder. This
will create the Tests folder with the NUnit
assembly file.
• Create a test script by pressing the Create Test
Script in current folder button. This can also be
done in the project view Create - Testing - C#
test script. If you have e.g. a class named
Spawner you want to test, name the test class
SpawnerTests.
4. REFERENCING ASSEMBLY DEFINITION FILES
• You need to create an assembly definition file in
your scripts folder (Create - Assembly
Definition) so your test assembly is able to
reference all your classes.
• Add this newly created assembly definition to the
reference list of the Tests.asmdef file in your
project/asset window.
• Note that if you're using Unity packages in your
project, such as Text Mesh Pro, you need to
reference its assembly definition file in your
projects assembly definition file.
• If you don’t link the assemblies, the tests classes
are not able to find the your actual game/app
scripts
5. CREATING THE FIRST UNIT TEST
• Decorate your test method with [Test] attribute for basic NUnit tests
• [UnityTest] behaves like a coroutine in PlayMode. You can skip a frame with yield return
null. This way for example the Update method in Monobehaviour classes gets run.
• The Assert class is used to test the conditions of the test.
• Run all your unit tests with the Run All button in the Test Runner. It will show tests that
passed and tests that failed
6. • All monobehaviour methods are invoked
• Tests run slower
• Build target is considered
PLAY MODE TESTS
• Awake and Start are not invoked
• Tests run faster (in editor)
• Build target does not matter
EDIT MODE TESTS
PLAY MODE VS EDIT MODE TESTS
7. STRUCTURING UNIT TESTS
1 ARRANGE - create all the needed objects and set their initial values and states
2 ACT - perform operations on the units to be tested, e.g. call a method
3 ASSERT - check that the outcome is correct and expected
Try to follow the ARRANGE - ACT - ASSERT Principle:
8. NAMING UNIT TESTS AND USING THE AAA-RULE
● A good naming convention is to start with the name of the method to be tested, followed by a
description of the input or the act phase, and finally what is the expected outcome. Separate the
three with an underscore. In this simple example we test the ReduceValue() method to see if the
new Value of the class is correct after calling the ReduceValue() with an input of 5
9. GOOD UNIT TESTS:
Don’t have any internal logic
Are simple, clean, maintainable and trustworthy
Isolated from everything else - “Solitary tests”
Not too generic but also not too specific
Only test the public methods of a class - “Don’t expose your privates!”
Test the right things. For example do not test Unity’s internal methods
10. TESTING MONOBEHAVIOUR CLASSES
● Unity's MonoBehaviour classes cannot be created with the new keyword as they are only
supposed to be added to GameObjects.
● So to test MonoBehaviours, you first need to create a gameobject, then add the class you want to
test with the AddComponent() method.
● MonoBehaviour methods, such as Awake(), Start() and Update() are private and should be kept
private for encapsulation. That is why it's cumbersome to call them in a normal test method. For
this Unity provides us the [UnityTest] attribute, which makes the test method behave like a
coroutine in PlayMode, and also allows to skip a frame in EditMode.
● By waiting for the next frame (or for several frames), the Awake(), Start() and Update() and other
Monobehaviour methods are called automatically.
12. INSTANTIATING PREFABS
● It is also possible to load / instantiate prefabs from the Resources folder and test that their
functionality work in isolation like this:
13. CREATING A SCRIPTABLE OBJECT INSTANCE
● Scriptable Objects are a great way of creating modular and testable code in Unity, as they can act
as mediators between classes or as simple data containers. As Scriptable Objects can exist as
assets in the project, they can essentially be injected to different classes in the Unity inspector.
● However, Scriptable Objects can't be constructed with the new keyword and instead need to be
instantiated with the CreateInstance() method:
14. SETUP AND TEARDOWN
● The [SetUp] attribute can be used to perform a set of actions before each test method
● Conversely, a method with the [TearDown] attribute is called automatically after each test.
15. ASSERTIONS
● There are a lot of different ways to use assertions in the test methods. Some examples:
● For more detailed information, refer to the NUnit documentation https://github.com/nunit/docs/wiki
16. TRUSTWORTHY TESTS
● It is important that you can trust your tests
● Start by writing a failing test and/or write a deliberate bug to see if the test passes
● If a test passes when it should not, there is something wrong with either the test or your code logic
17. CONSTRUCTING PRIVATE SERIALIZED FIELDS
● Private serialized fields that are assigned in the Unity inspector can be tricky in unit tests. There are
two different ways of setting their values. The first option is to use a public “constructor” method...
18. CONSTRUCTING PRIVATE SERIALIZED FIELDS
…and then calling the Construct() with the wanted values when setting up the object to be tested
19. USING REFLECTION FOR PRIVATE SERIALIZED FIELDS
● If you’d rather keep the original script classes intact without cluttering them with construct methods
just for unit tests, you can also use reflection to set values for the private fields:
22. TEST DOUBLES
● Quite often the methods that we want to test have dependencies to other classes
● To test the class and it’s methods in isolation, we need to create test doubles
● A test double can be used instead of the real object and made to behave like we want to. These are
often called spies, mocks, fakes or dummies.
● Creating test doubles is easy with NSubstitute
● Install NSubstitute via NuGet http://nsubstitute.github.io/
● Go to your .nuget packages folder in your OS user folder and locate the nsubstitute folder
● Copy the NSubstitute.dll file in the lib folder to your Unity project Editor folder
● In your test class, add using NSubstitute;
Installing NSubstitute
23. USING NSUBSTITUTE
● With NSubstitute, we can force the wanted behaviour on the test double
● In the following example, we set the weapon to return the value 20 as the blast power for weapon
number 2. This could then be used when testing another method that has a dependency to the
weapon and it’s GetBlastPower method.
24. TEST CASES
● To test the methods with different arguments, you can use test cases
● Both the method arguments and the expected result are given in the [TestCase] attribute
25. RUNNING TESTS IN CI/CD PIPELINES
● It is possible to run Unity and the test runner from the command line
● This makes it possible to integrate running unit tests as part of the cloud build pipelines
● Example: every time changes are committed to the master branch, the cloud machine runs the unit
tests and informs the user if any test failed
26. MORE INFORMATION:
● The Art of Unit Testing: with examples in C# by Roy Osherove
● Test Driven Development in Unity Youtube tutorial series by Infallible Code
● Unit Testing for C# Developers Udemy course by Mosh Hamedani
● Unity Test Runner documentation