public void GetAllMirror_ShouldReturnAllMirror() { var testProducts = FakeMirrorList(); var controller = new MirrorController(); int output = controller.GetMirrorFromDB2().Count; var result = controller.Get() as List <Mirror>; Assert.Equal(4, output); }
public void GetMirror_ShouldReturnCorrectMirror() { var testProducts = FakeMirrorList(); // create my list var controller = new MirrorController(); var result = controller.Get(4); Assert.NotNull(result); Assert.Equal(DateTime.Parse("21-11-20 00:00"), testProducts[0].DateTime); }
public void AssertNotNullResult() { //................Act............ var expected = FakeMirrorList(); // fake data from own unit test class var controller = new MirrorController(); // .............Arrange........and define a type which you get the object var result = controller.Get() as List <Mirror>; //we need object value var actual = result; //............Asset.............. Assert.NotNull(result); Debug.Assert(expected != null, nameof(expected) + " != null"); // Assert.Equal(expected, actual); }