[No Audio]
In this video, we're going to explore how we
can actually use Arrange/ Act/ Assert, and we're going
to actually write some test code in that format.
So in other words, we're writing our first test case.
Let's jump in now and see how we can do that together.
Now, if I want to stick to my Arrange/ Act/ Assert
I might say that a = 10
[No Audio]
B equals 20.
[No Audio]
result =
[No Audio]
Calculator
.add a, b
[No Audio]
and my assertion might be
[No Audio]
so equals. I expected to be 30.
[No Audio]
I can pass in the actual result here.
[No Audio]
Notice that I can use the static import there
as well, and just type assertEquals directly without
having to prefix it with assert..
So if I run this now,
[No Audio]
that should pass, that's all well and good. So great.
Now we know how to use Arrange/ Act/ Assert.
You should be able to write test going forwards.