public void QueryMatchFilterInvalidPortTest() { #region TestSetup var scenarioFaker = new Faker <Scenario>() .RuleFor(m => m.Id, f => f.Random.Word()); var fakeScenario = scenarioFaker.Generate(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Faults = new List <string>() { "fault" } }; #endregion var Target = new QueryMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var Actual = Target.Process(new ProcessMessagePort { Scenarios = input.Scenarios, Faults = input.Faults }).QueryMatchResults; Assert.Empty(Actual); }
public void GetTheLivingNeighboursOfASingleLivingCell() { var grid = new Grid(5, 5); int[][] graph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 1, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; _testHelper.TransformGraphToCells(graph).ForEach(cell => grid.AddCell(cell)); int[][] expectedLiveNeighboursGraph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; var expectedLiveNeighbours = _testHelper.TransformGraphToCells(expectedLiveNeighboursGraph); var cellTarget = new Cell(1, 1); var actualLiveNeighbours = grid.GetLiveNeighboursOfACell(cellTarget); expectedLiveNeighbours.Should().BeEquivalentTo(actualLiveNeighbours); Assert.Empty(actualLiveNeighbours); }
public void Assertions() { var condition = false; var text = "something"; var obj = new Auto(); var tokens = new List <string> { "public", "void", "return" }; var zero = 8 - 8; var someEnumerable = new List <string>(); Assert.False(condition); Assert.Equal("something", text); Assert.NotEqual("something else", text); Assert.Contains("tech", "technology"); // also DoesNotContain Assert.Matches(".*thing$", "something"); Assert.Throws <DivideByZeroException>(() => 4 / zero); Assert.Empty(someEnumerable); // also NotEmpty Assert.IsType <Auto>(obj); Assert.Collection(new List <int> { 2, 4 }, n => Assert.Equal(2, n), n => Assert.Equal(4, n) ); Assert.All(new List <string> { "a", "ab", "abc" }, s => s.StartsWith("a")); }
public void ReturnAnEmptyGridWhenAllALiveCellsDie() { _gameOfLife.SetGrid(5, 5); int[][] graph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 1, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; _testHelper.TransformGraphToCells(graph).ForEach(cell => _gameOfLife.AddCellToGrid(cell)); _gameOfLife.Evolve(); int[][] expectedLiveCellsGraph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; var expectedLiveCells = _testHelper.TransformGraphToCells(expectedLiveCellsGraph); var actualLivingCells = _gameOfLife.LivingCells; expectedLiveCells.Should().BeEquivalentTo(actualLivingCells); Assert.Empty(actualLivingCells); }
public void WillSupportLast() { using (var store = NewDocumentStore()) { using (var session = store.OpenSession()) { session.Store(new Student { Email = "*****@*****.**" }); session.SaveChanges(); } new Students_ByEmailDomain().Execute(store); using (var session = store.OpenSession()) { var results = session.Query <Students_ByEmailDomain.Result, Students_ByEmailDomain>() .Customize(customization => customization.WaitForNonStaleResults()) .ToList(); Assert.Empty(store.DatabaseCommands.GetStatistics().Errors); Assert.Equal(1, results.Count); } } }
public void HeaderMatchFilterInvalidPortTest() { #region Test Setup var fakeScenario = scenarioFaker.Generate(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Faults = new List <string> { "fault" } }; #endregion var Target = new HeaderMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var port = new ProcessMessagePort() { Scenarios = input.Scenarios, Faults = input.Faults }; var Actual = Target.Process(port).HeaderMatchResults; Assert.Empty(Actual); }
public void BodyMatchEqualitysPartialTripleNestedTestFail() { #region var fakeScenario = scenarioFaker.Generate(); fakeScenario.RequestMatchRules.BodyRules = new List <BodyRule> { new BodyRule(ComparerType.JSONEQUALITY, JObject.Parse("{'a': 'b'}")) }; var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Body = JObject.Parse("{'x': {'a': 'c'}, 'xy': {'a': 'd', 'b': {'a': 'b'}}}") }; #endregion var Target = new BodyMatchFilter <ProcessMessagePort>(new AssertFactory(), new RuleMatcher()); var Actual = Target.Process(new ProcessMessagePort() { Scenarios = input.Scenarios, Body = input.Body.ToString() }) .BodyMatchResults.Where(x => x.Match.Equals(MatchResultType.Success)).Select(x => x.ScenarioId); var Expected = new List <string> { fakeScenario.Id }; Assert.Empty(Actual); }
public void BodyMatchContainsNestedJSONKeyValueFirstTestFail() { #region var fakeScenario = scenarioFaker.Generate(); fakeScenario.RequestMatchRules.BodyRules = new List <BodyRule> { new BodyRule(ComparerType.JSONCONTAINS, JObject.Parse("{'a': 'b', 'c': 'd', 'e': {'f': 'g'}}")) }; var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Body = JObject.Parse("{'e': 'f'}") }; #endregion var Target = new BodyMatchFilter <ProcessMessagePort>(new AssertFactory(), new RuleMatcher()); var Actual = Target.Process(new ProcessMessagePort() { Scenarios = input.Scenarios, Body = input.Body.ToString() }) .BodyMatchResults.Where(x => x.Match.Equals(MatchResultType.Success)).Select(x => x.ScenarioId); var Expected = new List <string> { fakeScenario.Id }; Assert.Empty(Actual); }
public void EndpointMatchFilterNoMethodMatchTest() { #region TestSetup var faker = new Faker(); var httpMethods = new List <HttpMethod> { HttpMethod.Get, HttpMethod.Post, HttpMethod.Put, HttpMethod.Delete }; var fakeScenario = scenarioFaker.Generate(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Path = fakeScenario.Path, Verb = faker.PickRandom(httpMethods.Where(method => !method.Equals(fakeScenario.Verb))) }; #endregion var Target = new EndpointMatchFilter <ProcessMessagePort>(); var Actual = Target.Process(new ProcessMessagePort { Scenarios = input.Scenarios, Path = input.Path, Verb = input.Verb }).Scenarios; Assert.Empty(Actual); }
public void HeaderMatchFilterNoMatchTest() { #region Test Setup var fakeScenario = scenarioFaker.Generate(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Headers = fakeScenario.RequestMatchRules.HeaderRules.Select(x => new KeyValuePair <string, string>(x.RuleValue.Key, x.RuleValue.Value + "-unique")) }; #endregion var Target = new HeaderMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var port = new ProcessMessagePort() { Scenarios = input.Scenarios, Headers = input.Headers }; var Actual = Target.Process(port) .HeaderMatchResults.Where(x => x.Match.Equals(MatchResultType.Success)).Select(x => x.ScenarioId).ToList(); Assert.Empty(Actual); }
public void UrlMatchFilterNoMatchTest() { #region Test Setup var fakeScenario = scenarioFaker.Generate(); var faker = new Faker(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Path = faker.Random.AlphaNumeric(TestUtils.GetRandomStringLength()) }; #endregion var Target = new UrlMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var port = new ProcessMessagePort() { Scenarios = input.Scenarios, Path = input.Path }; var Actual = Target.Process(port) .URLMatchResults.Where(x => x.Match.Equals(MatchResultType.Success)).Select(x => x.ScenarioId).ToList(); Assert.Empty(Actual); }
public void GetPhoneNumberWhenWrongCountryCode_ShouldReturnEmptyString() { var phoneNumber = "+46 123 12 123"; phoneNumber = PhoneNumberHelper.Validate(phoneNumber); Assert.Empty(phoneNumber); }
public void GetPhoneNumberWhenNotValid_ShouldReturnEmptyString() { string phoneNumber = "0761234567"; phoneNumber = PhoneNumberHelper.Validate(phoneNumber); Assert.Empty(phoneNumber); }
public void GetPhoneNumberWhenNull_ShouldReturnEmptyString() { string phoneNumber = null; phoneNumber = PhoneNumberHelper.Validate(phoneNumber); Assert.Empty(phoneNumber); }
public void GetAllNoEntriesListTest() { #region Test Setup var options = new MemoryCacheOptions(); var cache = new MemoryCache(options); var getAllMockDefinitionsCommand = new GetAllMockDefinitionsCommand(ref TestUtils.databaseLock); #endregion var Target = new GetAllMockDefinitionsHandler(cache, data); var Actual = Target.Handle(getAllMockDefinitionsCommand, CancellationToken.None).Result; Assert.Empty(Actual); }
public void UsersEmptyPageMustBeReturned() { //Arrange var user1 = _databaseFixture.CreateFirstUser(); var user2 = _databaseFixture.CreateSecondUser(); var user3 = _databaseFixture.CreateThirdUser(); //Act _databaseFixture.DatabaseAdapter.AddUser(user1); _databaseFixture.DatabaseAdapter.AddUser(user2); _databaseFixture.DatabaseAdapter.AddUser(user3); var page = _databaseFixture.DatabaseAdapter.GetUsersPage(3, 5); //Assert Assert.NotNull(page); Assert.Empty(page); }
public void QueryMatchFilterNoScenariosMatchTest() { #region TestSetup var input = new { Scenarios = new List <Scenario>(), Query = new Dictionary <string, string>() }; #endregion var Target = new QueryMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var Actual = Target.Process(new ProcessMessagePort { Scenarios = input.Scenarios, Query = input.Query }).QueryMatchResults; Assert.Empty(Actual); }
public void SensorValuesMustBeRemovedWithProduct() { //Arrange var product = _databaseFixture.GetFirstTestProduct(); var info = _databaseFixture.CreateSensorInfo(); var data = _databaseFixture.CreateSensorValues(); _databaseFixture.DatabaseAdapter.AddProduct(product); _databaseFixture.DatabaseAdapter.AddSensor(info); //Act data.ForEach(d => _databaseFixture.DatabaseAdapter.PutSensorData(d, product.Name)); Thread.Sleep(5000); _databaseFixture.DatabaseAdapter.RemoveProduct(product.Name); var dataFromDB = _databaseFixture.DatabaseAdapter.GetSensorHistory(product.Name, info.Path, DateTime.MinValue); //Assert Assert.NotNull(dataFromDB); Assert.Empty(dataFromDB); }
public void EndpointMatchFilterNoScenariosMatchTest() { #region TestSetup var faker = new Faker(); var input = new { Scenarios = new List <Scenario>(), Path = faker.Lorem.Word(), Verb = HttpMethod.Get }; #endregion var Target = new EndpointMatchFilter <ProcessMessagePort>(); var Actual = Target.Process(new ProcessMessagePort { Scenarios = input.Scenarios, Path = input.Path, Verb = input.Verb }).Scenarios; Assert.Empty(Actual); }
public void HeaderMatchFilterNoScenarioTest() { #region Test Setup var input = new { Scenarios = new List <Scenario>(), Headers = new Dictionary <string, string>() }; #endregion var Target = new HeaderMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var port = new ProcessMessagePort() { Scenarios = input.Scenarios, Headers = input.Headers }; var Actual = Target.Process(port).HeaderMatchResults; Assert.Empty(Actual); }
public void QueryMatchFilterNoMatchTest() { #region TestSetup var assertFactory = new AssertFactory(); var faker = new Faker(); var fakerQueryRule = new Faker <KeyValuePairRule>() .CustomInstantiator(f => new KeyValuePairRule() { Type = f.PickRandom <ComparerType>(), RuleValue = new KeyValuePair <string, string>(f.Random.String(), f.Random.String()) }); var scenarioFaker = new Faker <Scenario>() .RuleFor(m => m.RequestMatchRules, f => new RequestMatchRules { QueryRules = fakerQueryRule.Generate(10) }) .RuleFor(m => m.Id, f => f.Random.Word()); var fakeScenario = scenarioFaker.Generate(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Query = new Dictionary <string, string>() }; #endregion var Target = new QueryMatchFilter <ProcessMessagePort>(assertFactory, ruleMatcher); var Actual = Target.Process(new ProcessMessagePort { Scenarios = input.Scenarios, Query = input.Query }) .QueryMatchResults.Where(x => x.Match == MatchResultType.Success).Select(y => y.ScenarioId).ToList(); Assert.Empty(Actual); }
public void GetNoLiveCellThatShouldDieWhenTheyHaveTwoOrThreeNeighbours() { var grid = new Grid(5, 5); int[][] graph = { new[] { 0, 0, 1, 0, 0 }, new[] { 0, 1, 0, 1, 0 }, new[] { 0, 0, 1, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; _testHelper.TransformGraphToCells(graph).ForEach(cell => grid.AddCell(cell)); var allLiveNeighboursOfAliveCells = new List <Cell>(); foreach (var livingCell in grid.LivingCells) { allLiveNeighboursOfAliveCells.AddRange(grid.GetLiveNeighboursOfACell(livingCell)); } int[][] expectedDeadCellsGraph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; var expectedDeadCells = _testHelper.TransformGraphToCells(expectedDeadCellsGraph); var neighboursOfCellsCount = grid.GetLiveCellsAndItsNumberOfLiveNeighboursDict(); var actualDeadCells = _rules.GetLiveCellsThatShouldDie(neighboursOfCellsCount); expectedDeadCells.Should().BeEquivalentTo(actualDeadCells); Assert.Empty(actualDeadCells); }
public async Task Record() { var grain = this.fixture.GrainFactory.GetGrain <ICountersGrain>(0, "TestGrains.CountersGrain"); var currentstate = await grain.GetTentativeState(); Assert.NotNull(currentstate); Assert.Empty(currentstate); await grain.Add("Alice", 1, false); await grain.Add("Alice", 1, false); await grain.Add("Alice", 1, false); // all three updates should be visible in the tentative count (even if not confirmed yet) Assert.Equal(3, await grain.GetTentativeCount("Alice")); // reset all counters to zero, and wait for confirmation await grain.Reset(true); Assert.Empty((await grain.GetTentativeState())); }
public void EndpointMatchFilterNoPathMatchTest() { #region TestSetup var fakeScenario = scenarioFaker.Generate(); var input = new { Scenarios = new List <Scenario>() { fakeScenario }, Path = fakeScenario.Path + "/diff", Verb = fakeScenario.Verb }; #endregion var Target = new EndpointMatchFilter <ProcessMessagePort>(); var Actual = Target.Process(new ProcessMessagePort { Scenarios = input.Scenarios, Path = input.Path, Verb = input.Verb }).Scenarios; Assert.Empty(Actual); }
public async Task QueryExecuteUnconnectedUriTest() { // Given: // If: // ... I request to execute a query using a file URI that isn't connected var workspaceService = GetDefaultWorkspaceService(Constants.StandardQuery); var queryService = Common.GetPrimedExecutionService(null, false, false, false, workspaceService); var queryParams = new ExecuteDocumentSelectionParams { OwnerUri = "notConnected", QuerySelection = Common.WholeDocument }; var efv = new EventFlowValidator <ExecuteRequestResult>() .AddStandardErrorValidation() .Complete(); await Common.AwaitExecution(queryService, queryParams, efv.Object); // Then: // ... All events should have been called as per their flow validator efv.Validate(); // ... There should be no active queries Assert.Empty(queryService.ActiveQueries); }
public async Task PostThenDelete() { var chat = this.fixture.GrainFactory.GetGrain <IChatGrain>($"Chatroom-{Guid.NewGuid()}"); var guid = Guid.NewGuid(); await chat.Post(guid, "Famous Athlete", "I am retiring"); { var content = (await chat.GetChat()).ToString(); var doc = XDocument.Load(new StringReader(content)); var container = doc.GetPostsContainer(); Assert.Single(container.Elements("post")); } await chat.Delete(guid); { var content = (await chat.GetChat()).ToString(); var doc = XDocument.Load(new StringReader(content)); var container = doc.GetPostsContainer(); Assert.Empty(container.Elements("post")); } }
public void GetNoDeadCellsThatShouldBecomeAliveWhenTheyDoNotHaveThreeLiveNeighbours() { var grid = new Grid(5, 5); int[][] graph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 1, 0, 1, 0 }, new[] { 1, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; _testHelper.TransformGraphToCells(graph).ForEach(cell => grid.AddCell(cell)); var allDeadNeighboursOfAliveCells = new List <Cell>(); foreach (var livingCell in grid.LivingCells) { allDeadNeighboursOfAliveCells.AddRange(grid.GetDeadNeighboursOfACell(livingCell)); } int[][] expectedLiveCellsGraph = { new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 }, new[] { 0, 0, 0, 0, 0 } }; var expectedLiveCells = _testHelper.TransformGraphToCells(expectedLiveCellsGraph); var cellsThatShouldLive = _rules.GetDeadCellsThatShouldLive(allDeadNeighboursOfAliveCells); expectedLiveCells.Should().BeEquivalentTo(expectedLiveCells); Assert.Empty(cellsThatShouldLive); }
public void EnsureCancellingDoesNotLoseItems() { var inFlightObjects = new List <FakeData>(); int processed = 0; int sent = 0; processor.Received += o => { lock (inFlightObjects) { inFlightObjects.Remove(o); Interlocked.Increment(ref processed); } }; // start and stop processing multiple times, checking items are in a good state each time. for (int i = 0; i < 5; i++) { var cts = new CancellationTokenSource(); var sendTask = Task.Run(() => { while (!cts.IsCancellationRequested) { var obj = FakeData.New(); lock (inFlightObjects) { processor.PushToQueue(obj); inFlightObjects.Add(obj); } Interlocked.Increment(ref sent); } }, CancellationToken.None); var receiveTask = Task.Run(() => processor.Run((cts = new CancellationTokenSource()).Token), CancellationToken.None); Thread.Sleep(1000); cts.Cancel(); sendTask.Wait(10000); receiveTask.Wait(10000); output.WriteLine($"Sent: {sent} In-flight: {inFlightObjects.Count} Processed: {processed}"); Assert.Equal(inFlightObjects.Count, processor.GetQueueSize()); } var finalCts = new CancellationTokenSource(10000); processor.Received += _ => { if (inFlightObjects.Count == 0) { // early cancel once the list is emptied. finalCts.Cancel(); } }; // process all remaining items processor.Run(finalCts.Token); Assert.Empty(inFlightObjects); Assert.Equal(0, processor.GetQueueSize()); output.WriteLine($"Sent: {sent} In-flight: {inFlightObjects.Count} Processed: {processed}"); }
public void ConversionTest() { Single s = 2.5F; double d; Conversion conv; // primitives Assert.True(Conversion.TryGetConversion(typeof(Single), typeof(double), out conv)); Assert.False(conv.IsExplicit); object o = conv.Converter(s); d = (double)o; Console.WriteLine("{0}: {1}", o.GetType(), d); Assert.True(Conversion.TryGetConversion(typeof(double), typeof(Single), out conv)); Assert.True(conv.IsExplicit); o = conv.Converter(d); s = (Single)o; Console.WriteLine("{0}: {1}", o.GetType(), s); Assert.True(Conversion.TryGetConversion(typeof(object), typeof(double), out conv)); Assert.True(conv.IsExplicit); o = conv.Converter(s); d = (double)o; Console.WriteLine("{0}: {1}", o.GetType(), d); Assert.True(Conversion.TryGetConversion(typeof(double), typeof(int), out conv)); Assert.True(conv.IsExplicit); try { o = conv.Converter(d); Assert.True(false, "double to int conversion should not have succeeded."); } catch (ArgumentException ex) { Console.WriteLine("Correctly failed with exception: " + ex); } // enums Assert.True(Conversion.TryGetConversion(typeof(string), typeof(BindingFlags), out conv)); Assert.True(conv.IsExplicit); BindingFlags flags = (BindingFlags)conv.Converter("Public"); // array up-conversion Assert.True(Conversion.TryGetConversion(typeof(double), typeof(double[]), out conv)); o = conv.Converter(d); double[] array = (double[])o; Console.WriteLine("{0}: {1}", o.GetType(), array[0]); Assert.True(Conversion.TryGetConversion(typeof(double[]), typeof(double[, ]), out conv)); o = conv.Converter(array); double[,] array2 = (double[, ])o; Console.WriteLine("{0}: {1}", o.GetType(), array2[0, 0]); Assert.True(Conversion.TryGetConversion(typeof(System.Reflection.Missing), typeof(double[]), out conv)); o = conv.Converter(d); array = (double[])o; Assert.Empty(array); Console.WriteLine("{0}: Length={1}", o.GetType(), array.Length); // class up-conversion Assert.True(Conversion.TryGetConversion(typeof(PositiveDefiniteMatrix), typeof(Matrix), out conv)); Assert.True(conv.Converter == null); // interface up-conversion Assert.True(Conversion.TryGetConversion(typeof(double[]), typeof(IList), out conv)); Assert.True(conv.Converter == null); // array covariance (C# 2.0 specification, sec 20.5.9) Assert.True(Conversion.TryGetConversion(typeof(string[]), typeof(IList <string>), out conv)); Assert.True(conv.Converter == null); Assert.True(Conversion.TryGetConversion(typeof(string[]), typeof(IList <object>), out conv)); Assert.True(conv.Converter == null); Assert.False(Conversion.TryGetConversion(typeof(string[, ]), typeof(IList <string>), out conv)); Assert.False(Conversion.TryGetConversion(typeof(string[, ]), typeof(IList <object>), out conv)); // array element conversion Assert.True(Conversion.TryGetConversion(typeof(object[]), typeof(double[]), out conv)); Assert.True(conv.IsExplicit); object[] oa = new object[2] { 1.1, 2.2 }; o = conv.Converter(oa); array = (double[])o; Assert.Equal(oa[0], array[0]); Assert.Equal(oa[1], array[1]); Console.WriteLine("{0}: {1} {2}", o.GetType(), array[0], array[1]); // array down-conversion Assert.True(Conversion.TryGetConversion(typeof(double[, ]), typeof(double[]), out conv)); array2 = new double[, ] { { 1.1, 2.2 } }; o = conv.Converter(array2); array = (double[])o; Console.WriteLine("{0}: {1} {2}", o.GetType(), array[0], array[1]); // custom conversion Assert.True(Conversion.TryGetConversion(typeof(Tester), typeof(int), out conv)); Tester t = new Tester(); o = conv.Converter(t); Console.WriteLine("{0}: {1}", o.GetType(), o); Assert.True(Conversion.TryGetConversion(typeof(Tester), typeof(int[]), out conv)); o = conv.Converter(t); Console.WriteLine("{0}: {1}", o.GetType(), o); // conversion from null Assert.False(Conversion.TryGetConversion(typeof(Nullable), typeof(int), out conv)); Assert.True(Conversion.TryGetConversion(typeof(Nullable), typeof(int?), out conv)); Assert.True(Conversion.TryGetConversion(typeof(Nullable), typeof(int[]), out conv)); }
public void GetTest_Bad_EmptyResult() { var res = _empty.Get(); Assert.Empty(res); }