public void TestQueryParametres() { query1 = new WindowsFormsApplication1.SourceQuery("1.1.1.1"); query2 = new WindowsFormsApplication1.DestQuery("2.2.2.2"); query3 = new WindowsFormsApplication1.ProtocolQuery("ICMP"); Assert.That(query1.Or(query2.Or(query3)).IsSatisfiedBy(parametr1), Is.True); Assert.That(query1.And(query2.And(query3)).IsSatisfiedBy(parametr1), Is.False); Assert.That(query1.Or(query2.And(query3)).IsSatisfiedBy(parametr2), Is.False); query1 = new WindowsFormsApplication1.SourceQuery("1.3.1.3"); Assert.That(query1.And(query2.Or(query3)).IsSatisfiedBy(parametr2), Is.True); }
public void TestQueryDevice() { query1 = new WindowsFormsApplication1.IPQuery("1.1.1.1"); query2 = new WindowsFormsApplication1.TypeQuery("Принтер"); Assert.That(query1.Or(query2).IsSatisfiedBy(device1), Is.True); Assert.That(query1.And(query2).IsSatisfiedBy(device1), Is.False); }
public void TestGetStructure() { queryip = new WindowsFormsApplication1.IPQuery("192.168.0.25"); querytype = new WindowsFormsApplication1.TypeQuery("Компьютер"); Assert.That(devicerepos.GetStructure(queryip), Is.Not.Empty); Assert.That(devicerepos.GetStructure(querytype), Is.Not.Empty); queryip = new WindowsFormsApplication1.IPQuery("321.543.0000.25"); querytype = new WindowsFormsApplication1.TypeQuery(""); Assert.That(devicerepos.GetStructure(queryip.And(querytype)), Is.Empty); queryip = new WindowsFormsApplication1.IPQuery(""); querytype = new WindowsFormsApplication1.TypeQuery("Тест"); Assert.That(devicerepos.GetStructure(querytype.Or(queryip)), Is.Not.Empty); }