public void IfIDontPassAnObjectToTheConstructorItFails()
 {
     try
     {
         classToTest = new ClassOne(null);
         Assert.Fail();
     }
     catch (NotObjectPassedException)
     {
         Assert.IsTrue(true);
     }
 }
 public void IfIDontPassAnObjectToMethodOneItFails()
 {
     try
     {
         classToTest = new ClassOne(new object());
         classToTest.MethodOne(null);
         Assert.Fail();
     }
     catch (NotObjectPassedException)
     {
         Assert.IsTrue(true);
     }
 }
 public void MethodOneDoesSomeThingAndReturnsSomething()
 {
     classToTest = new ClassOne(new object());
     var result = classToTest.MethodOne(new List());
     Assert.IsTrue(result);
 }
 public void MethodOneDoesSomethingAndReturnsOtherThing()
 {
     classToTest = new ClassOne(new object());
     var result = classToTest.MethodOne(string.Empty);
     Assert.IsFalse(result);
 }
 public void FinishTest()
 {
     classToTest = null;
 }
Beispiel #6
0
 public void MethodOneDoesSomeThingAndReturnsSomething()
 {
     classToTest = new ClassOne(new object());
     var result = classToTest.MethodOne(new List());
     result.Should().Be(true);
 }
Beispiel #7
0
 public void MethodOneDoesSomethingAndReturnsOtherThing()
 {
     classToTest = new ClassOne(new object());
     var result = classToTest.MethodOne(string.Empty);
     result.Should().Be(false);
 }
Beispiel #8
0
 public void IfIDontPassAnObjectToMethodOneItFails()
 {
     classToTest = new ClassOne(new object());
     Action act = () => classToTest.MethodOne(null);
     act.ShouldThrow<NotObjectPassedException>();
 }