public void Assert_WhenArgumentIsMethodFromClass_ThrowsApplicationException() { var classSut = new ValuesSut(); Unit.Assert.Throws <ApplicationException>(() => Assert(() => classSut.Method())); Unit.Assert.Throws <ApplicationException>(() => Assert(() => ValuesSut.StaticMethod())); }
public void Assert_WhenArgumentIsPropertyFromClass_ReturnsCorrectMetadata() { var classSut = new ValuesSut(); var actualMetadata = Assert(() => classSut.Property); var expectedMetadata = new Metadata <string>(classSut.Property, nameof(classSut.Property)); Unit.Assert.AreEqual(expectedMetadata.Value, actualMetadata.Value); Unit.Assert.AreEqual(expectedMetadata.Name, actualMetadata.Name); }