public void Radial_DrawPieSlices() { var doc = this.GetNewDoc(); var app = doc.Application; var page = app.ActivePage; var center = new VA.Drawing.Point(4, 5); double radius = 1.0; var values = new[] {1.0, 2.0}; var slices = VisioAutomation.Models.Charting.PieSlice.GetSlicesFromValues(center, radius, values); var shapes = new IVisio.Shape[values.Length]; for (int i=0 ;i<values.Length;i++) { var slice = slices[i]; var shape = slice.Render(page); shapes[i] = shape; shape.Text = values[i].ToString(CultureInfo.InvariantCulture); } var shapeids = shapes.Select(s => s.ID).ToList(); var xfrms = VisioAutomation.Shapes.XFormCells.GetCells(page, shapeids); Assert.AreEqual("4.25 in", xfrms[0].PinX.Formula); Assert.AreEqual("5.5 in", xfrms[0].PinY.Formula); Assert.AreEqual("4 in", xfrms[1].PinX.Formula); Assert.AreEqual("4.9330127018922 in", xfrms[1].PinY.Formula); doc.Close(true); }
public void FormatSimpleValues() { string[] values = new[] { "1", "2", "hello", "world" }; string expected = "1,2,hello,world\r\n"; Assert.AreEqual(expected, this.testee.Write(values, ",")); }
public void CHARACTERISATION_WriteJson_WhenValueHasObjectMessageObject_ShouldRewriteMessageToObjectValue() { //---------------Set up test pack------------------- var messageData = new { Message = GetRandomString(1, 5), MessageObject = new { MooCow = GetRandomString(6, 10) } }; var writer = Substitute.For<JsonWriter>(); var serializer = Substitute.For<JsonSerializer>(); var sut = Create(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- sut.WriteJson(writer, messageData, serializer); //---------------Test Result ----------------------- Received.InOrder(() => { writer.WritePropertyName("Message"); writer.WriteValue(messageData.MessageObject.MooCow); writer.WriteValue(messageData.MessageObject.MooCow); }); }
public void TrailingWhiteSpaces() { string[] values = new[] { " 1 ", "\t2 ", "hello\t", "\tworld\t" }; string expected = "\" 1 \",\"\t2 \",\"hello\t\",\"\tworld\t\"\r\n"; Assert.AreEqual(expected, this.testee.Write(values, ",")); }
public void Should_Generate_Yeast() { var possibleValues = Resources.Beer.Yeast.Split(';'); var actualValue = new[] { Beer.Yeast() }; Assert.That(actualValue, Is.SubsetOf(possibleValues)); }
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { var memberNames = new[] {validationContext.MemberName}; PropertyInfo otherPropertyInfo = validationContext.ObjectType.GetProperty(OtherProperty); if (otherPropertyInfo == null) { return new ValidationResult(String.Format(CultureInfo.CurrentCulture, ValidatorResources.EqualTo_UnknownProperty, OtherProperty), memberNames); } var displayAttribute = otherPropertyInfo.GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault() as DisplayAttribute; if (displayAttribute != null && !string.IsNullOrWhiteSpace(displayAttribute.Name)) { OtherPropertyDisplayName = displayAttribute.Name; } object otherPropertyValue = otherPropertyInfo.GetValue(validationContext.ObjectInstance, null); if (!Equals(value, otherPropertyValue)) { return new ValidationResult(FormatErrorMessage(validationContext.DisplayName), memberNames); } return null; }
public void EmbeddedDoubleQuotes() { string[] values = new[] { "hello \"world\"", "The answer is \"42\"" }; string expected = "\"hello \"world\"\",\"The answer is \"42\"\"\r\n"; Assert.AreEqual(expected, this.testee.Write(values, ",")); }
public void EmbeddedLineBreak() { string[] values = new[] { "hello\r\nworld", "The answer is\r\n42" }; string expected = "\"hello\r\nworld\",\"The answer is\r\n42\"\r\n"; Assert.AreEqual(expected, this.testee.Write(values, ",")); }
public void SystemListSeparatorIsUsedAsDefaultSeparator() { string[] values = new[] { "hello", "world" }; string expected = "hello" + CultureInfo.CurrentCulture.TextInfo.ListSeparator + "world\r\n"; Assert.AreEqual(expected, this.testee.Write(values)); }
public SphericalMercatorWorldSchema() { var resolutions = new[] { 156543.033900000, 78271.516950000, 39135.758475000, 19567.879237500, 9783.939618750, 4891.969809375, 2445.984904688, 1222.992452344, 611.496226172, 305.748113086, 152.874056543, 76.437028271, 38.218514136, 19.109257068, 9.554628534, 4.777314267, 2.388657133, 1.194328567, 0.597164283}; var count = 0; foreach (var resolution in resolutions) { Resolutions[count] = new Resolution {Id = count.ToString(CultureInfo.InvariantCulture), UnitsPerPixel = resolution}; count++; } Height = 256; Width = 256; Extent = new Extent(-20037508.342789, -20037508.342789, 20037508.342789, 20037508.342789); OriginX = -20037508.342789; OriginY = -20037508.342789; Name = "WorldSphericalMercator"; Format = "png"; Axis = AxisDirection.Normal; Srs = "EPSG:3857"; }
public UnProjected() { var resolutions = new[] { 0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 3.4332275390625e-4, 1.71661376953125e-4, 8.58306884765625e-5, 4.291534423828125e-5, }; var count = 0; foreach (var resolution in resolutions) { Resolutions.Add(new Resolution { Id = count.ToString(CultureInfo.InvariantCulture), UnitsPerPixel = resolution }); count++; } Height = 256; Width = 256; Extent = new Extent(-180, -90, 180, 90); OriginX = -180; OriginY = -90; Name = "UnProjected"; Format = "image/png"; Axis = AxisDirection.Normal; Srs = "EPSG:4326"; }
internal static InvalidOperationException DeriveParametersNotSupported(Type type, CommandType commandType) { var args = new[] {type.ToString(), commandType.ToString()}; return new InvalidOperationException( GetExceptionMessage( "{0} DeriveParameters only supports CommandType.StoredProcedure, not CommandType.{1}.", args)); }
internal static ArgumentException InvalidSizeValue(int value) { var args = new[] {value.ToString()}; return new ArgumentException( GetExceptionMessage( "Invalid parameter Size value '{0}'. The value must be greater than or equal to 0.", args)); }
public ODataSingletonRoutingTest() { var controllers = new[] { typeof(VipCustomerController) }; var configuration = controllers.GetHttpConfiguration(); configuration.MapODataServiceRoute(new CustomersModelWithInheritance().Model); _server = new HttpServer(configuration); _client = new HttpClient(_server); }
public void SystemListSeparatorIsUsedAsDefaultSeparator() { string[] values = new[] { "hello", "world" }; string expected = "hello" + CultureInfo.CurrentCulture.TextInfo.ListSeparator + "world\r\n"; var result = this.testee.Write(values); result.Should().Be(expected); }
public byte[] FrameMessage(byte[] messageBytes) { var initialBytes = new[] { StartFrame }; var finalBytes = new [] { EndFrame }; var msg = initialBytes .Concat(messageBytes) .Concat(finalBytes) .ToArray(); return msg; }
public void SerializeTest() { var mock = new Mock<IStringSerializer<int>>(MockBehavior.Strict); var collectionStringSerializer = new CollectionStringSerializer<int>(mock.Object); var ints = new[] {1, 100, 200}; mock.Setup(x => x.Serialize(1)).Returns("1").Verifiable(); mock.Setup(x => x.Serialize(100)).Returns("100").Verifiable(); mock.Setup(x => x.Serialize(200)).Returns("200").Verifiable(); Assert.AreEqual("1\x001F100\x001F200", collectionStringSerializer.Serialize(ints)); mock.VerifyAll(); }
public static string BreakUpCamelCase(string fieldName) { var patterns = new[] { "([a-z])([A-Z])", "([0-9])([a-zA-Z])", "([a-zA-Z])([0-9])" }; var output = patterns.Aggregate(fieldName, (current, pattern) => Regex.Replace(current, pattern, "$1 $2", RegexOptions.IgnorePatternWhitespace)); return output.Replace('_', ' '); }
private static IVisio.Shape draw_leaf(IVisio.Page page, VA.Drawing.Point p0) { var p1 = p0.Add(1, 1); var p2 = p1.Add(1, 0); var p3 = p2.Add(1, -1); var p4 = p3.Add(-1, -1); var p5 = p4.Add(-1, 0); var p6 = p5.Add(-1, 1); var bezier_points = new[] {p0, p1, p2, p3, p4, p5, p6}; var s = page.DrawBezier(bezier_points); return s; }
public void RecentFiles() { var files = new[] { new RecentFile(new FileInfo(@"C:\\File1.txt")), new RecentFile(new FileInfo(@"C:\\File2.txt")) }; var converter = new RecentFilesToStateConverter(); var state = converter.Convert(files); var restored = converter.Convert(state); restored.ShouldAllBeEquivalentTo(files); }
private void ListWindow(int windowId) { if (_branchNameList != null) { _scrollViewVector = GUILayout.BeginScrollView(_scrollViewVector); var options = new[] { GUILayout.Width(160f), GUILayout.ExpandWidth(false) }; _selectionGridInt = GUILayout.SelectionGrid(_selectionGridInt, _branchNameList.ToArray(), 1, options); GUILayout.EndScrollView(); } GUILayout.BeginHorizontal(); if (GUILayout.Button("Change Archive")) { ChangeArch(); } if (GUILayout.Button("New")) { _shownewbdial = true; } if (GUILayout.Button("Del")) { _showdeldial = true; } GUILayout.EndHorizontal(); if (!_isorig()) { if (GUILayout.Button("Return to master")) { RestoreOrig(); } } GUILayout.BeginHorizontal(); GUI.contentColor = Color.green; // Refresh images list. if (GUILayout.Button("Refresh list")) { GetBranches(); } GUI.contentColor = Color.white; if (GUILayout.Button("Commit")) { _showcommitdial = true; } GUILayout.EndHorizontal(); // Close the list window. if (GUI.Button(new Rect(2f, 2f, 13f, 13f), "X")) { _visible = !_visible; } // Makes the window dragable. GUI.DragWindow(); }
public static ITileSchema GetSchema() { var resolutions = new[] { 156543.033928, 78271.5169639999, 39135.7584820001, 19567.8792409999, 9783.93962049996, 4891.96981024998, 2445.98490512499, 1222.99245256249, 611.49622628138, 305.748113140558, 152.874056570411, 76.4370282850732, 38.2185141425366, 19.1092570712683, 9.55462853563415, 4.77731426794937, 2.38865713397468, 1.19432856685505, 0.597164283559817, 0.298582141647617 }; var schema = new TileSchema(); var counter = 0; foreach (var resolution in resolutions) { schema.Resolutions.Add(new Resolution { UnitsPerPixel = resolution, Id = counter++.ToString(CultureInfo.InvariantCulture) }); } schema.Height = 256; schema.Width = 256; schema.Extent = new Extent(-20037507.2295943, -19971868.8804086, 20037507.2295943, 19971868.8804086); schema.OriginX = -20037508.342787; schema.OriginY = 20037508.342787; schema.Name = "ESRI"; schema.Format = "JPEG"; schema.Axis = AxisDirection.InvertedY; schema.Srs = string.Format("EPSG:{0}", 102100); return schema; }
public IndexModule() { this.Get["/"] = parameters => { // NOTE (adamralph): in a real world app you probably wouldn't use configuration directly within a HTTP module in this way // in a real world app you'd typically use configuration to configure your IoC container // in the case of a Nancy app, this would be done in your custom bootstrapper var greeting = string.Format( CultureInfo.InvariantCulture, "{0}, I'm built for {1}!", Configurator.Get<string>("greeting"), Configurator.Get<string>("builtfor")); var model = new { Greeting = greeting }; return View["index", model]; }; }
public static void Spirograph() { var page = SampleEnvironment.Application.ActiveDocument.Pages.Add(); page.Name = "Spirograph"; var colors = new[] { 0xf26420, 0xf7931c, 0xfec20d, 0xfff200, 0xcada28, 0x8cc63e, 0x6c9d30, 0x288f39, 0x006f3a, 0x006f71, 0x008eb0, 0x00adee, 0x008ed3, 0x0071bb, 0x0053a6, 0x2e3091, 0x5b57a6, 0x652d91, 0x92278e, 0xbd198c, 0xec008b, 0xec1c23, 0xc1272c, 0x981a1e }; var origin = new VA.Drawing.Point(4, 4); double radius = 3.0; int numpoints = colors.Length; double angle_step = (System.Math.PI*2/numpoints); var angles = Enumerable.Range(0, numpoints).Select(i => i*angle_step).ToList(); var centers = angles.Select(a => PlaygroundSamples.GetPointAtRadius(origin, a, radius)).ToList(); var shapes = centers.Select(p => PlaygroundSamples.draw_leaf(page, p)).ToList(); var angles_as_formulas = angles.Select(a => a.ToString(CultureInfo.InvariantCulture)).ToList(); var color_formulas = colors.Select(x => new VA.Drawing.ColorRGB(x).ToFormula()).ToList(); var shapeids = shapes.Select(s => s.ID16).ToList(); var update = new VA.ShapeSheet.Update(); var format = new VA.Shapes.FormatCells(); var xfrm = new VA.Shapes.XFormCells(); foreach (int i in Enumerable.Range(0, shapeids.Count)) { short shapeid = shapeids[i]; xfrm.Angle = angles_as_formulas[i]; format.FillForegnd = color_formulas[i]; format.LineWeight = 0; format.LinePattern = 0; format.FillForegndTrans = 0.5; update.SetFormulas(shapeid, xfrm); update.SetFormulas(shapeid, format); } update.Execute(page); VA.Pages.PageHelper.ResizeToFitContents(page, new VA.Drawing.Size(1.0, 1.0)); }
public ChangeLanguageController() { _chooseLanguage = new SingleChoiceAction(this, "ChooseLanguage", PredefinedCategory.Tools); _chooseLanguage.Execute+=ChooseLanguage_Execute; _chooseFormattingCulture = new SingleChoiceAction(this, "ChooseFormattingCulture", PredefinedCategory.Tools); _chooseFormattingCulture.Execute+=ChooseFormattingCulture_Execute; var defaultCulture = CultureInfo.InvariantCulture.TwoLetterISOLanguageName; var defaultFormattingCulture = CultureInfo.CurrentCulture.TwoLetterISOLanguageName; _chooseLanguage.Items.Add(new ChoiceActionItem(string.Format("Default ({0})",defaultCulture), defaultCulture)); _chooseFormattingCulture.Items.Add(new ChoiceActionItem(string.Format("Default ({0})", defaultFormattingCulture), defaultFormattingCulture)); var languages = new[]{"German (de)", "Spanish (es)", "Japanese (ja)", "Russian (ru)"}; foreach (var language in languages) { _chooseFormattingCulture.Items.Add(new ChoiceActionItem(language, null)); _chooseLanguage.Items.Add(new ChoiceActionItem(language, null)); } }
public void CanConvert_ShouldAlwaysReturnTrue() { //---------------Set up test pack------------------- // Create two new anonymous types which the SUT definitely can't know about var obj1 = new { }; var obj2 = new { }; var sut = Create(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var result1 = sut.CanConvert(obj1.GetType()); var result2 = sut.CanConvert(obj2.GetType()); //---------------Test Result ----------------------- Assert.IsTrue(result1); Assert.IsTrue(result2); }
public WkstNederlandSchema() { var unitsPerPixelArray = new[] { 3440.64, 1720.32, 860.16, 430.08, 215.04, 107.52, 53.76, 26.88, 13.44, 6.72, 3.36, 1.68, 0.84, 0.42, 0.21 }; var count = 0; foreach (var unitsPerPixel in unitsPerPixelArray) { var levelId = count.ToString(CultureInfo.InvariantCulture); Resolutions[levelId] = new Resolution ( levelId, unitsPerPixel, TileSize, TileSize, _originX, _originY ); count++; } Extent = new Extent(-285401.920, 22598.080, 595401.92, 903401.920); OriginX = _originX; OriginY = _originY; Name = "urn:ogc:def:wkss:OGC:1.0:NLDEPSG28992Scale"; Format = "png"; YAxis = YAxis.TMS; Srs = "EPSG:28992"; }
public string Execute(ISolrConnection connection) { var deleteNode = new XElement("delete"); if (parameters != null) { if (parameters.CommitWithin.HasValue) { var attr = new XAttribute("commitWithin", parameters.CommitWithin.Value.ToString(CultureInfo.InvariantCulture)); deleteNode.Add(attr); } } var param = new[] { KV.Create(FromPending, "fromPending"), KV.Create(FromCommitted, "fromCommitted") }; foreach (var p in param) { if (p.Key.HasValue) { var att = new XAttribute(p.Value, p.Key.Value.ToString().ToLower()); deleteNode.Add(att); } } deleteNode.Add(deleteParam.ToXmlNode().ToArray()); return connection.Post("/update", deleteNode.ToString(SaveOptions.DisableFormatting)); }
public void TryParseIntArray() { const string successValue1 = "10"; const string successValue2 = "20"; var errorValue1 = double.MaxValue.ToString(CultureInfo.InvariantCulture); var errorValue2 = double.MinValue.ToString(CultureInfo.InvariantCulture); var successByteValues = new[] { successValue1.TryParseInt(), successValue2.TryParseInt() }; var successValues = new[] { successValue1, successValue2 }; var errorValues = new[] { errorValue1, errorValue2 }; var mixedValues = new[] { successValue1, successValue2, errorValue1, errorValue2 }; #region full method (with number format), without default, dont return defult conversion var successConversion = string.Join(",", successValues).TryParseIntArray(null, false, BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(successConversion, "Error converting string to int array"); Assert.IsTrue(successConversion.Any(), "Error converting string to int array"); Assert.IsFalse(successConversion.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(successConversion.Count() == successByteValues.Count(), "Error converting string to int array"); var falseConversions = string.Join(",", errorValues).TryParseIntArray(null, false, BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(falseConversions, "Error converting string to int array"); Assert.IsFalse(falseConversions.Any(), "Error converting string to int array"); var mixedConversions = string.Join(",", mixedValues).TryParseIntArray(null, false, BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(mixedConversions, "Error converting string to int array"); Assert.IsFalse(mixedConversions.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(mixedConversions.Count() == successByteValues.Count(), "Error converting string to int array"); #endregion #region partial method (with number format), without default successConversion = string.Join(",", successValues).TryParseIntArray(null, BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(successConversion, "Error converting string to int array"); Assert.IsTrue(successConversion.Any(), "Error converting string to int array"); Assert.IsFalse(successConversion.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(successConversion.Count() == successByteValues.Count(), "Error converting string to int array"); falseConversions = string.Join(",", errorValues).TryParseIntArray(null, BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(falseConversions, "Error converting string to int array"); Assert.IsFalse(falseConversions.Any(), "Error converting string to int array"); mixedConversions = string.Join(",", mixedValues).TryParseIntArray(null, BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(mixedConversions, "Error converting string to int array"); Assert.IsFalse(mixedConversions.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(mixedConversions.Count() == successByteValues.Count(), "Error converting string to int array"); #endregion #region simple method (with number format) successConversion = string.Join(",", successValues).TryParseIntArray( BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(successConversion, "Error converting string to int array"); Assert.IsTrue(successConversion.Any(), "Error converting string to int array"); Assert.IsFalse(successConversion.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(successConversion.Count() == successByteValues.Count(), "Error converting string to int array"); falseConversions = string.Join(",", errorValues).TryParseIntArray( BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(falseConversions, "Error converting string to int array"); Assert.IsFalse(falseConversions.Any(), "Error converting string to int array"); mixedConversions = string.Join(",", mixedValues).TryParseIntArray( BasePrimitivesExtensions.GetDefaultIntNumberStyle(), BasePrimitivesExtensions.GetCurrentCulture()); Assert.IsNotNull(mixedConversions, "Error converting string to int array"); Assert.IsFalse(mixedConversions.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(mixedConversions.Count() == successByteValues.Count(), "Error converting string to int array"); #endregion #region full method (without number format), without default, dont return defult conversion successConversion = string.Join(",", successValues).TryParseIntArray(null, false); Assert.IsNotNull(successConversion, "Error converting string to int array"); Assert.IsTrue(successConversion.Any(), "Error converting string to int array"); Assert.IsFalse(successConversion.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(successConversion.Count() == successByteValues.Count(), "Error converting string to int array"); falseConversions = string.Join(",", errorValues).TryParseIntArray(null, false); Assert.IsNotNull(falseConversions, "Error converting string to int array"); Assert.IsFalse(falseConversions.Any(), "Error converting string to int array"); mixedConversions = string.Join(",", mixedValues).TryParseIntArray(null, false); Assert.IsNotNull(mixedConversions, "Error converting string to int array"); Assert.IsFalse(mixedConversions.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(mixedConversions.Count() == successByteValues.Count(), "Error converting string to int array"); #endregion #region partial method (without number format), without default successConversion = string.Join(",", successValues).TryParseIntArray(null); Assert.IsNotNull(successConversion, "Error converting string to int array"); Assert.IsTrue(successConversion.Any(), "Error converting string to int array"); Assert.IsFalse(successConversion.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(successConversion.Count() == successByteValues.Count(), "Error converting string to int array"); falseConversions = string.Join(",", errorValues).TryParseIntArray(null); Assert.IsNotNull(falseConversions, "Error converting string to int array"); Assert.IsFalse(falseConversions.Any(), "Error converting string to int array"); mixedConversions = string.Join(",", mixedValues).TryParseIntArray(null); Assert.IsNotNull(mixedConversions, "Error converting string to int array"); Assert.IsFalse(mixedConversions.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(mixedConversions.Count() == successByteValues.Count(), "Error converting string to int array"); #endregion #region simple method (without number format) successConversion = string.Join(",", successValues).TryParseIntArray(); Assert.IsNotNull(successConversion, "Error converting string to int array"); Assert.IsTrue(successConversion.Any(), "Error converting string to int array"); Assert.IsFalse(successConversion.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(successConversion.Count() == successByteValues.Count(), "Error converting string to int array"); falseConversions = string.Join(",", errorValues).TryParseIntArray(); Assert.IsNotNull(falseConversions, "Error converting string to int array"); Assert.IsFalse(falseConversions.Any(), "Error converting string to int array"); mixedConversions = string.Join(",", mixedValues).TryParseIntArray(); Assert.IsNotNull(mixedConversions, "Error converting string to int array"); Assert.IsFalse(mixedConversions.Any(a => !successByteValues.Contains(a)), "Error converting string to int array"); Assert.IsTrue(mixedConversions.Count() == successByteValues.Count(), "Error converting string to int array"); #endregion }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); var supportedCultures = new[] { new CultureInfo("es"), new CultureInfo("es-MX") }; app.UseRequestLocalization(new RequestLocalizationOptions { DefaultRequestCulture = new RequestCulture("es"), // Formatting numbers, dates, etc. SupportedCultures = supportedCultures, // UI strings that we have localized. SupportedUICultures = supportedCultures }); env.ConfigureNLog("nlog.config"); }