public void ConstructorWithLazyFuncShouldSetExpectedName() { // arrange var expected = "Testing.Test"; var annotation = new InstanceAnnotation(new Lazy <Func <object, object> >(() => o => o), expected, new Mock <IEdmTypeConfiguration>().Object); // act var actual = annotation.QualifiedName; // assert Assert.Equal(expected, actual); }
public void GetValueShouldReturnAnnotationValue() { // arrange var expected = new TimeSpan(8, 0, 0); var instance = new Entity() { Timestamp = expected }; var annotation = new InstanceAnnotation(o => ((Entity)o).Timestamp, "testing.timestamp", new Mock <IEdmTypeConfiguration>().Object); // act var actual = annotation.GetValue(instance); // assert Assert.Equal(expected, actual); }
public void ConstructorWithLazyFuncShouldSetExpectedAnnotationTypeName() { // arrange var expected = "Test"; var typeConfig = new Mock <IEdmTypeConfiguration>(); typeConfig.SetupGet(tc => tc.FullName).Returns(expected); var annotation = new InstanceAnnotation(new Lazy <Func <object, object> >(() => o => o), "testing.annotation", typeConfig.Object); // act var actual = annotation.AnnotationTypeName; // assert Assert.Equal(expected, actual); }