Ejemplo n.º 1
0
		public void WhenSetInvalidTimeoutThenLeaveDefault()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
				b.Timeout = 0;
			});

			configure.NamedQueries.Values.Single().Timeout.Should().Be(-1);
		}
Ejemplo n.º 2
0
		public void WhenSetValidTimeoutThenSetValue()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
				b.Timeout = 123;
			});

			configure.NamedQueries.Values.Single().Timeout.Should().Be(123);
		}
Ejemplo n.º 3
0
		public void WhenSetValidFetchSizeThenSetValue()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
				b.FetchSize = 15;
			});

			configure.NamedQueries.Values.Single().FetchSize.Should().Be(15);
		}
Ejemplo n.º 4
0
		public void WhenSetValidTimeoutThenSetValue()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
				b.Timeout = 123;
			});

			Assert.That(configure.NamedQueries.Values.Single().Timeout, Is.EqualTo(123));
		}
Ejemplo n.º 5
0
		public void WhenSetValidFetchSizeThenSetValue()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
				b.FetchSize = 15;
			});

			Assert.That(configure.NamedQueries.Values.Single().FetchSize, Is.EqualTo(15));
		}
Ejemplo n.º 6
0
		public void AddSimpleNamedQuery()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
			});

			configure.NamedQueries.Should().Have.Count.EqualTo(1);
			configure.NamedQueries.Keys.Single().Should().Be("aQuery");
			configure.NamedQueries.Values.Single().Query.Should().Be("from System.Object o");
		}
Ejemplo n.º 7
0
		public void AddSimpleNamedQuery()
		{
			var configure = new Configuration();
			configure.AddNamedQuery("aQuery", b =>
			{
				b.Query = "from System.Object o";
			});

			Assert.That(configure.NamedQueries, Has.Count.EqualTo(1));
			Assert.That(configure.NamedQueries.Keys.Single(), Is.EqualTo("aQuery"));
			Assert.That(configure.NamedQueries.Values.Single().Query, Is.EqualTo("from System.Object o"));
		}