public void Test_CellPassAttributeFilter_Prepare() { CellPassAttributeFilter filter = new CellPassAttributeFilter(); filter.ClearFilter(); Assert.False(filter.AnyFilterSelections, "AnyFilterSelections not false"); Assert.False(filter.AnyMachineEventFilterSelections, "AnyMachineEventFilterSelections not false"); Assert.False(filter.AnyNonMachineEventFilterSelections, "AnyNonMachineEventFilterSelections not false"); filter.HasTimeFilter = true; Assert.True(filter.AnyFilterSelections, "AnyFilterSelections not true after adding time filter"); Assert.False(filter.AnyMachineEventFilterSelections, "AnyMachineEventFilterSelections not false"); Assert.True(filter.AnyNonMachineEventFilterSelections, "AnyNonMachineEventFilterSelections not true after adding time filter"); filter.ClearFilter(); filter.HasPositioningTechFilter = true; Assert.True(filter.AnyFilterSelections, "AnyFilterSelections not true"); Assert.True(filter.AnyMachineEventFilterSelections, "AnyMachineEventFilterSelections not true"); Assert.False(filter.AnyNonMachineEventFilterSelections, "AnyNonMachineEventFilterSelections true"); }
private void Test_CellPassAttributeFilter_ClearFilterAll_CheckByAspect(Action <CellPassAttributeFilter, bool> setAspect, Func <CellPassAttributeFilter, bool> getAspect) { CellPassAttributeFilter filter = new CellPassAttributeFilter(); filter.AnyFilterSelections.Should().BeFalse(); getAspect.Invoke(filter).Should().BeFalse(); setAspect.Invoke(filter, true); filter.AnyFilterSelections.Should().BeTrue(); getAspect.Invoke(filter).Should().BeTrue(); filter.HasTimeFilter = true; filter.ClearFilter(); filter.AnyFilterSelections.Should().BeFalse(); filter.HasTimeFilter.Should().BeFalse(); }
public void Test_CellPassAttributeFilter_Assign() { CellPassAttributeFilter filter1 = new CellPassAttributeFilter(); CellPassAttributeFilter filter2 = new CellPassAttributeFilter(); filter1.ClearFilter(); filter2.ClearFilter(); filter1.MaterialTemperatureMin = 10; filter1.MaterialTemperatureMax = 30; filter1.HasTemperatureRangeFilter = true; filter1.FilterTemperatureByLastPass = true; filter1.MachinesList = new Guid[] { Guid.NewGuid(), Guid.NewGuid(), }; //Assert.Equal(-1, filter1.CompareTo(filter2)); filter2.Assign(filter1); //Assert.Equal(0, filter1.CompareTo(filter2)); filter1.Should().BeEquivalentTo(filter2); }