public void VerifyWritableForAllPropertiesOnMutableClass() { var fixture = new Fixture(); var assertion = new WritablePropertyAssertion(fixture); var properties = typeof(DoublePropertyHolder <string, int>).GetProperties(); assertion.Verify(properties); }
public void VerifyWritableForProperty() { var fixture = new Fixture(); var assertion = new WritablePropertyAssertion(fixture); var property = typeof(PropertyHolder <object>).GetProperty("Property"); assertion.Verify(property); }
public void Test_UserInfoViewModel_auto_properties(WritablePropertyAssertion assertion) { var properties = new Properties<UserInfoViewModel>(); assertion.Verify(properties.Select(x => x.BirthDate)); assertion.Verify(properties.Select(x => x.LastName)); assertion.Verify(properties.Select(x => x.Name)); assertion.Verify(properties.Select(x => x.Picture)); }
public void Test_Getter_And_Setters_FoodDto(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <FoodDto>().Select(c => c.Id)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Name)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Calories)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Type)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Created)); }
public void Test_user_profile_auto_properties(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <UserProfile>().Select(d => d.ApplicationUser)); assertion.Verify(new Properties <UserProfile>().Select(d => d.BirthDate)); assertion.Verify(new Properties <UserProfile>().Select(d => d.LastName)); assertion.Verify(new Properties <UserProfile>().Select(d => d.Name)); assertion.Verify(new Properties <UserProfile>().Select(d => d.Picture)); assertion.Verify(new Properties <UserProfile>().Select(d => d.UserId)); }
public void SutIsIdiomaticAssertion() { // Arrange var dummyComposer = new Fixture(); // Act var sut = new WritablePropertyAssertion(dummyComposer); // Assert Assert.IsAssignableFrom <IdiomaticAssertion>(sut); }
public void VerifyNullPropertyThrows() { // Arrange var dummyComposer = new Fixture(); var sut = new WritablePropertyAssertion(dummyComposer); // Act & Assert Assert.Throws <ArgumentNullException>(() => sut.Verify((PropertyInfo)null)); }
public void VerifyReadOnlyPropertyDoesNotThrow() { // Arrange var dummyComposer = new Fixture(); var sut = new WritablePropertyAssertion(dummyComposer); var propertyInfo = typeof(ReadOnlyPropertyHolder <object>).GetProperty("Property"); // Act & Assert Assert.Null(Record.Exception(() => sut.Verify(propertyInfo))); }
public void ComposerIsCorrect() { // Arrange var expectedComposer = new Fixture(); var sut = new WritablePropertyAssertion(expectedComposer); // Act ISpecimenBuilder result = sut.Builder; // Assert Assert.Equal(expectedComposer, result); }
public void SutIsIdiomaticAssertion() { // Fixture setup var dummyComposer = new Fixture(); // Exercise system var sut = new WritablePropertyAssertion(dummyComposer); // Verify outcome Assert.IsAssignableFrom <IdiomaticAssertion>(sut); // Teardown }
public void VerifyNullPropertyThrows() { // Fixture setup var dummyComposer = new Fixture(); var sut = new WritablePropertyAssertion(dummyComposer); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.Verify((PropertyInfo)null)); // Teardown }
public void Test_Getter_And_Setters_FoodDto(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <FoodDto>().Select(c => c.Id)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Name)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Category)); assertion.Verify(new Properties <FoodDto>().Select(c => c.CategoryId)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Currency)); assertion.Verify(new Properties <FoodDto>().Select(c => c.DeletedPictures)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Description)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Pictures)); assertion.Verify(new Properties <FoodDto>().Select(c => c.Price)); }
public void Test_food_auto_properties(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <Food>().Select(d => d.Name)); assertion.Verify(new Properties <Food>().Select(d => d.Description)); assertion.Verify(new Properties <Food>().Select(d => d.Recept)); assertion.Verify(new Properties <Food>().Select(d => d.Pictures)); assertion.Verify(new Properties <Food>().Select(d => d.Price)); assertion.Verify(new Properties <Food>().Select(d => d.Currency)); assertion.Verify(new Properties <Food>().Select(d => d.Category)); assertion.Verify(new Properties <Food>().Select(d => d.CategoryId)); assertion.Verify(new Properties <Food>().Select(d => d.CategoryId)); }
public void VerifyReadOnlyPropertyDoesNotThrow() { // Fixture setup var dummyComposer = new Fixture(); var sut = new WritablePropertyAssertion(dummyComposer); var propertyInfo = typeof(ReadOnlyPropertyHolder <object>).GetProperty("Property"); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Verify(propertyInfo)); // Teardown }
public void Properties_VerifyAssigned() { // arrange var assertion = new WritablePropertyAssertion(Fixture); // act var sut = Fixture.Create <BikeShopWebApiInstaller>(); var props = sut.GetType().GetProperties(); // assert. assertion.Verify(props); }
public void ComposerIsCorrect() { // Fixture setup var expectedComposer = new Fixture(); var sut = new WritablePropertyAssertion(expectedComposer); // Exercise system ISpecimenBuilder result = sut.Builder; // Verify outcome Assert.Equal(expectedComposer, result); // Teardown }
public void Properties_VerifyAssigned() { // arrange var assertion = new WritablePropertyAssertion(Fixture); // act var sut = Fixture.Create <WindsorRelease>(); var props = sut.GetType().GetProperties(); // assert. assertion.Verify(props); }
public void VerifyIllBehavedPropertySetterThrows() { // Arrange var composer = new Fixture(); var sut = new WritablePropertyAssertion(composer); var propertyInfo = typeof(IllBehavedPropertyHolder <object>).GetProperty("PropertyIllBehavedSet"); // Act & Assert var e = Assert.Throws <WritablePropertyException>(() => sut.Verify(propertyInfo)); Assert.Equal(propertyInfo, e.PropertyInfo); }
public void VerifyWellBehavedWritablePropertyDoesNotThrow() { // Fixture setup var composer = new Fixture(); var sut = new WritablePropertyAssertion(composer); var propertyInfo = typeof(PropertyHolder <object>).GetProperty("Property"); // Exercise system and verify outcome Assert.Null(Record.Exception(() => sut.Verify(propertyInfo))); // Teardown }
public void AutoFixture_Idioms() { //arrange var fixture = new Fixture(); var assertion = new WritablePropertyAssertion(fixture); //act var sut = fixture.Create <Core.Blog>(); var props = sut.GetType().GetProperties(); //assert assertion.Verify(props); }
public void VerifyIllBehavedPropertySetterThrows() { // Fixture setup var composer = new Fixture(); var sut = new WritablePropertyAssertion(composer); var propertyInfo = typeof(IllBehavedPropertyHolder <object>).GetProperty("PropertyIllBehavedSet"); // Exercise system and verify outcome var e = Assert.Throws <WritablePropertyException>(() => sut.Verify(propertyInfo)); Assert.Equal(propertyInfo, e.PropertyInfo); // Teardown }
public void Properties_VerifyAssigned() { // arrange var assertion = new WritablePropertyAssertion(Fixture); Fixture.Inject <IWindsorContainer>(new WindsorContainer()); var sut = Fixture.Create <WindsorControllerActivator>(); // act var props = sut.GetType().GetProperties(); // assert. assertion.Verify(props); }
public void EnsuresSameValueInProperty(WritablePropertyAssertion assertion) { assertion.Verify(typeof(PropertySetter)); }
public void Properties_AreWritable(WritablePropertyAssertion assertion, IFixture fixture) { fixture.MakeNonRecursive(); assertion.Verify(typeof(GraphNode)); }
public void Tets_Getter_And_Setters_CategoryDto(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <CategoryDto>().Select(c => c.Id)); assertion.Verify(new Properties <CategoryDto>().Select(c => c.Name)); assertion.Verify(new Properties <CategoryDto>().Select(c => c.Color)); }
public void RemainingCapacityIsWritable(WritablePropertyAssertion assertion) { assertion.Verify(Reflect <BookingViewModel> .GetProperty <int>(sut => sut.RemainingCapacity)); }
public void Test_user_auto_properties(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <LoginDto>().Select(d => d.Login)); assertion.Verify(new Properties <LoginDto>().Select(d => d.Password)); }
public void DayIsWritable(WritablePropertyAssertion assertion) { assertion.Verify(Reflect <DateViewModel> .GetProperty <int>(sut => sut.Day)); }
public void WritablePropertiesBehaveCorrectly(WritablePropertyAssertion assertion) { // Exercise system and verify outcome assertion.Verify(typeof(JSendClientSettings).GetProperties()); }
public void Test_user_auto_properties(WritablePropertyAssertion assertion) { assertion.Verify(new Properties <ApplicationUser>().Select(d => d.UserProfile)); }