This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace Tests | |
{ | |
[TestClass] | |
public class AsyncTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using Lucene.Net.Linq; | |
using Lucene.Net.Linq.Fluent; | |
using Lucene.Net.Store; | |
using Lucene.Net.Util; | |
using NUnit.Framework; | |
namespace LinqLuceneTest | |
{ | |
public class Customer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Raven.Tests.Helpers; | |
using Xunit; | |
namespace RavenTests | |
{ | |
public class DateRangeTest : RavenTestBase | |
{ | |
public class Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int days = 678; | |
// First, you need a starting point | |
Instant now = SystemClock.Instance.Now; | |
DateTimeZone timeZone = DateTimeZoneProviders.Bcl.GetSystemDefault(); // or whatever the applicable time zone is | |
LocalDate today = now.InZone(timeZone).Date; | |
// then just add the number of days | |
LocalDate future = today.PlusDays(days); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- | |
This shows how you can calculate the elapsed time in MSBuild | |
--> | |
<Target Name="BeforeBuild"> | |
<PropertyGroup> | |
<startTime>$([System.DateTime]::UtcNow)</startTime> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Threading; | |
namespace ConsoleApplication | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Xunit; | |
using Xunit.Abstractions; | |
namespace XUnitJsonTest | |
{ | |
public class Class1 | |
{ | |
private readonly ITestOutputHelper _output; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MySql.Data.MySqlClient; | |
using MySql.Data.Types; | |
namespace TestMySql | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var builder = new ContainerBuilder(); | |
builder.RegisterInstance(store) | |
.As<IDocumentStore>() | |
.SingleInstance(); | |
builder.Register(ctx => ctx.Resolve<IDocumentStore>().OpenSession()) | |
.As<IDocumentSession>() | |
.InstancePerLifetimeScope(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function guessTimeZone() { | |
// First try ECMA-402 time zone detection, unless true is passed for testing the rest of this function. | |
if (!arguments[0] && typeof Intl === "object" && typeof Intl.DateTimeFormat === "function") { | |
var tz = Intl.DateTimeFormat().resolvedOptions().timeZone; | |
if (tz === "UTC") return "Etc/UTC"; | |
if (tz && tz.indexOf('/') > -1) return tz; | |
} | |
// get the current timestamp - used throughout |
OlderNewer