コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public void TestCreateTypeQuery()
 {
     query = new WindowsFormsApplication1.TypeQuery("Компьютер");
     Assert.That(query, Is.Not.Null);
     Assert.That(query, Is.InstanceOf(typeof(WindowsFormsApplication1.Query)));
     Assert.That(query, Is.TypeOf(typeof(WindowsFormsApplication1.TypeQuery)));
     Assert.That(query.IsSatisfiedBy(device1), Is.True);
     Assert.That(query.IsSatisfiedBy(device2), Is.False);
     query = new WindowsFormsApplication1.TypeQuery("");
     Assert.That(query.IsSatisfiedBy(device1), Is.True);
     Assert.That(query.IsSatisfiedBy(device2), Is.True);
 }
コード例 #4
0
 public void TestCreateProtocolQuery()
 {
     query = new WindowsFormsApplication1.ProtocolQuery("TCP");
     Assert.That(query, Is.Not.Null);
     Assert.That(query, Is.InstanceOf(typeof(WindowsFormsApplication1.Query)));
     Assert.That(query, Is.TypeOf(typeof(WindowsFormsApplication1.ProtocolQuery)));
     Assert.That(query.IsSatisfiedBy(parametr1), Is.True);
     Assert.That(query.IsSatisfiedBy(parametr2), Is.False);
     query = new WindowsFormsApplication1.ProtocolQuery("");
     Assert.That(query.IsSatisfiedBy(parametr1), Is.True);
     Assert.That(query.IsSatisfiedBy(parametr2), Is.True);
 }
コード例 #5
0
 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);
 }