public void InitializingContentTypesShouldYieldCorrectResult() { //Arrange var types = ContentTypeBuilder.LoadTypes("CodeFirst.Tests").ToList(); //Act var contentTypes = ContentTypeBuilder.InitializeContentTypes(types); //Assert Assert.Collection(contentTypes, (f) => { Assert.Equal("Person", f.ContentType.Name); Assert.Equal("Person", f.ContentType.SystemProperties.Id); Assert.Null(f.ContentType.DisplayField); Assert.Null(f.ContentType.Description); Assert.Equal(3, f.ContentType.Fields.Count); }, (f) => { Assert.Equal("SomethingElse", f.ContentType.Name); Assert.Equal("something", f.ContentType.SystemProperties.Id); Assert.Equal("field1", f.ContentType.DisplayField); Assert.Equal("Some description", f.ContentType.Description); Assert.Equal(6, f.ContentType.Fields.Count); } ); }
public void LoadingContentTypesShouldYieldCorrectNumberOfTypes() { //Arrange //Act var types = ContentTypeBuilder.LoadTypes("CodeFirst.Tests").ToList(); //Assert Assert.Collection(types, (f) => { Assert.Equal("ClassWithAttributes", f.Name); }, (f) => { Assert.Equal("Person", f.Name); }); }