public void TestThatExcludeReturnTrueIfValueIsNull() { var fixture = new Fixture(); fixture.Customize <Type>(e => e.FromFactory(() => typeof(object))); fixture.Customize <ITable>(e => e.FromFactory(() => MockRepository.GenerateMock <ITable>())); fixture.Customize <IField>(e => e.FromFactory(() => MockRepository.GenerateMock <IField>())); fixture.Customize <IMap>(e => e.FromFactory(() => MockRepository.GenerateMock <IMap>())); var criteria = new ExcludeFieldCriteria(fixture.CreateAnonymous <IField>()); Assert.That(criteria, Is.Not.Null); Assert.That(criteria.Exclude(null), Is.True); }
public void TestThatConstructorInitializeCriteria() { var fixture = new Fixture(); fixture.Customize <Type>(e => e.FromFactory(() => typeof(object))); fixture.Customize <ITable>(e => e.FromFactory(() => MockRepository.GenerateMock <ITable>())); fixture.Customize <IField>(e => e.FromFactory(() => MockRepository.GenerateMock <IField>())); fixture.Customize <IMap>(e => e.FromFactory(() => MockRepository.GenerateMock <IMap>())); var fieldMock = fixture.CreateAnonymous <Field>(); var criteria = new ExcludeFieldCriteria(fieldMock); Assert.That(criteria, Is.Not.Null); Assert.That(criteria.Field, Is.Not.Null); Assert.That(criteria.Field, Is.EqualTo(fieldMock)); }
public void TestThatAsSqlReturnsStringCriteria() { var fixture = new Fixture(); fixture.Customize <Type>(e => e.FromFactory(() => typeof(object))); fixture.Customize <ITable>(e => e.FromFactory(() => MockRepository.GenerateMock <ITable>())); fixture.Customize <IField>(e => e.FromFactory(() => MockRepository.GenerateMock <IField>())); fixture.Customize <IMap>(e => e.FromFactory(() => MockRepository.GenerateMock <IMap>())); var criteria = new ExcludeFieldCriteria(fixture.CreateAnonymous <IField>()); Assert.That(criteria, Is.Not.Null); var sqlCriteria = criteria.AsSql(); Assert.That(sqlCriteria, Is.Not.Null); Assert.That(sqlCriteria, Is.Empty); }