SlideShare a Scribd company logo
Thread base theory test
Thread base theory test
Thread base theory test
Thread base theory test
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
Thread base theory test
Thread base theory test
ApprovalTests

More Related Content

PDF
Clojure functions examples
PDF
The Ring programming language version 1.10 book - Part 79 of 212
PPTX
The next step, part 2
PDF
The Ring programming language version 1.7 book - Part 48 of 196
PDF
The Ring programming language version 1.5.1 book - Part 63 of 180
PDF
The Ring programming language version 1.6 book - Part 68 of 189
PDF
The Ring programming language version 1.5.4 book - Part 66 of 185
PDF
The Ring programming language version 1.5.1 book - Part 62 of 180
Clojure functions examples
The Ring programming language version 1.10 book - Part 79 of 212
The next step, part 2
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.5.1 book - Part 63 of 180
The Ring programming language version 1.6 book - Part 68 of 189
The Ring programming language version 1.5.4 book - Part 66 of 185
The Ring programming language version 1.5.1 book - Part 62 of 180

What's hot (20)

KEY
Scala on Your Phone
ZIP
Easy undo.key
PPTX
Introduzione a .NET / Mono
PDF
The Ring programming language version 1.9 book - Part 71 of 210
PDF
The Ring programming language version 1.5 book - Part 8 of 31
PDF
The Ring programming language version 1.8 book - Part 74 of 202
PDF
The Ring programming language version 1.6 book - Part 55 of 189
PDF
The Ring programming language version 1.10 book - Part 64 of 212
PDF
The Ring programming language version 1.6 book - Part 69 of 189
PDF
The Ring programming language version 1.7 book - Part 72 of 196
PDF
C++ practical
PDF
Property Based Testing
PDF
The Ring programming language version 1.5.1 book - Part 65 of 180
PDF
The Ring programming language version 1.9 book - Part 78 of 210
PDF
The Ring programming language version 1.4.1 book - Part 13 of 31
PDF
The Ring programming language version 1.6 book - Part 64 of 189
PPTX
Introduction to Unit Testing (Part 2 of 2)
PDF
The Ring programming language version 1.5.4 book - Part 67 of 185
PDF
The Ring programming language version 1.10 book - Part 74 of 212
PDF
JJUG CCC 2011 Spring
Scala on Your Phone
Easy undo.key
Introduzione a .NET / Mono
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.6 book - Part 69 of 189
The Ring programming language version 1.7 book - Part 72 of 196
C++ practical
Property Based Testing
The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.6 book - Part 64 of 189
Introduction to Unit Testing (Part 2 of 2)
The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.10 book - Part 74 of 212
JJUG CCC 2011 Spring
Ad

Viewers also liked (13)

PPTX
Approval testing from basic to advanced
PPTX
Strategy agile games 2015
PPTX
The curse of knowledge
PPTX
Lean coffee
PPTX
Increase testability with code seams
PPTX
Exploratory and Unit Testing
PPTX
Advanced unit testing
PPTX
The curse of knowledge
PPTX
Mob testing
PPTX
Intentional code
PPTX
Getting existing code under tests
PPTX
Strong Style Pairing
Approval testing from basic to advanced
Strategy agile games 2015
The curse of knowledge
Lean coffee
Increase testability with code seams
Exploratory and Unit Testing
Advanced unit testing
The curse of knowledge
Mob testing
Intentional code
Getting existing code under tests
Strong Style Pairing
Ad

More from Llewellyn Falco (17)

PPTX
Lets connect linked_in
PPTX
Test driven development done well
PPTX
Do not use the greater than sign in programming
PPTX
Cutting code quickly
PPTX
The falco technical coaching framework
PPTX
Expressive objects
PPTX
Roi on learning hour
PPTX
Mob programming
PPTX
Developing design sense of code smells
PPTX
Exceptional exceptions
PDF
Koans randori role cards
PPTX
Teaching kids programming with the Intentional Method
PPTX
How Games Teach
PPTX
Some Helpful Observations for successful Mob Programming
PPTX
State of teaching in video games
PDF
Do it yourself Code Report (blank)
PDF
The code report (v1)
Lets connect linked_in
Test driven development done well
Do not use the greater than sign in programming
Cutting code quickly
The falco technical coaching framework
Expressive objects
Roi on learning hour
Mob programming
Developing design sense of code smells
Exceptional exceptions
Koans randori role cards
Teaching kids programming with the Intentional Method
How Games Teach
Some Helpful Observations for successful Mob Programming
State of teaching in video games
Do it yourself Code Report (blank)
The code report (v1)

Recently uploaded (20)

PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
AutoCAD Professional Crack 2025 With License Key
PPTX
Transform Your Business with a Software ERP System
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Reimagine Home Health with the Power of Agentic AI​
Advanced SystemCare Ultimate Crack + Portable (2025)
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
L1 - Introduction to python Backend.pptx
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Design an Analysis of Algorithms II-SECS-1021-03
Designing Intelligence for the Shop Floor.pdf
AutoCAD Professional Crack 2025 With License Key
Transform Your Business with a Software ERP System
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Why Generative AI is the Future of Content, Code & Creativity?
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY
Oracle Fusion HCM Cloud Demo for Beginners
Computer Software and OS of computer science of grade 11.pptx
Patient Appointment Booking in Odoo with online payment
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025

Thread base theory test

  • 5. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 6. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 7. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 8. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 9. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 10. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 11. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 12. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 13. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }