Closed AdamNorberg closed 3 years ago
I added tests for .Equals
and ==
, too, so we can see that the Assert.Equals
method is indeed testing something, not just running into an Equals method that always returns true...
I changed the name, but took no action for the other comments. Give it another look?
Obviously, this is just a start - there's a lot of behavior in Real and all of it needs to be tested. But, I believe in small, easily-reviewed changes, and this passes, so why not push it in as an example of how an xUnit test looks?
A public method in an xUnit project with a
[Fact]
annotation is expected to be making "factual assertions" - its assertions should always hold. (A[Theory]
is a test that takes parameters, and its assertions are only expected to pass with certain combinations of parameters. You'll see those later.) So, this asserts that simple addition works - as long as my Equals function isn't just returning "yes" all the time. Hm, better check that, too...