static AssertionExtensions() { Services.TestFramework = new SilverlightTestFramework(); Services.Reflector = new SilverlightReflector(); Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
public DirectoryTableView(DirectoryInfo directory) { if (directory == null) { throw new ArgumentNullException(nameof(directory)); } Add(new ContentView("\n")); Add(new ContentView(Span($"Directory: {directory.FullName.Rgb(235, 30, 180)}"))); Add(new ContentView("\n")); var tableView = new TableView <FileSystemInfo>(); tableView.Items = directory.EnumerateFileSystemInfos() .OrderByDescending(f => f is DirectoryInfo) .ToList(); tableView.AddColumn( cellValue: f => f is DirectoryInfo ? f.Name.LightGreen() : f.Name.White(), header: new ContentView("Name".Underline())); tableView.AddColumn( cellValue: f => Span(f.CreationTime), header: new ContentView("Created".Underline())); tableView.AddColumn( cellValue: f => Span(f.LastWriteTime), header: new ContentView("Modified".Underline())); Add(tableView); Formatter.AddFormatter <DateTime>(d => $"{d:d} {ForegroundColorSpan.DarkGray()}{d:t}"); }
/// <inheritdoc /> public IdentityRepositoryTests(ITestOutputHelper outputHelper, DatabaseFixture fixture) : base( outputHelper, fixture) { Formatter.AddFormatter(PersonIdentifierFormatter.Instance); Formatter.AddFormatter(DictionaryIdentifierFormatter.Instance); personOne = new PersonEntity(); personTwo = new PersonEntity(); defaultAuthority = new AuthorityEntity("Default " + Random.String(), 1000, Random.String()); Context.AddRange(personOne, personTwo); Context.Add(defaultAuthority); testIdentifierDefinition = Identifiers.Definitions.String("Test"); Context.AddRange( NhsNumberEntity(personOne, personOneNhsNumber), NhsNumberEntity(personTwo, personTwoNhsNumber), IdentifierEntity(personOne, testIdentifierDefinition, personTwoNhsNumber, defaultAuthority) ); Context.SaveChanges(); Assert.NotNull(readContext.People.Find(personOne.Id)); Assert.NotNull(readContext.People.Find(personTwo.Id)); Assert.Equal(2, readContext.Set <PersonIdentifierEntity>().Count(_ => _.Person == personOne)); Assert.Single(readContext.Set <PersonIdentifierEntity>().Where(_ => _.Person == personTwo)); repository = CreateRepository(CreateNewContextInSameTransaction()); }
static AssertionExtensions() { Services.Reflector = new WpReflector(); Services.ThrowException = TestFrameworkProvider.Throw; Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
static AssertionExtensions() { Services.ThrowException = message => { throw new AssertFailedException(message); }; Services.Reflector = new SilverlightReflector(); Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
static AssertionExtensions() { Services.Configuration = new Configuration(new AppSettingsConfigurationStore()); Services.TestFramework = TestFrameworkProvider.TestFramework; Services.Reflector = new DefaultReflector(); Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
public void Initialize() { Services.ThrowException = TestFrameworkProvider.Throw; Formatter.AddFormatter(new AggregateExceptionValueFormatter()); Formatter.AddFormatter(new XDocumentValueFormatter()); Formatter.AddFormatter(new XElementValueFormatter()); Formatter.AddFormatter(new XAttributeValueFormatter()); }
public void Initialize() { if (Services.ThrowException == null) { Services.ThrowException = message => { throw new AssertionFailedException(message); }; } Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
static AssertionExtensions() { if (Services.ThrowException == null) { Services.ThrowException = message => { throw new AssertionFailedException(message); }; } Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
public void Initialize() { Services.ThrowException = message => { throw new AssertFailedException(message); }; Services.Reflector = new SilverlightReflector(); Formatter.AddFormatter(new AggregateExceptionValueFormatter()); Formatter.AddFormatter(new XDocumentValueFormatter()); Formatter.AddFormatter(new XElementValueFormatter()); Formatter.AddFormatter(new XAttributeValueFormatter()); }
public void FormatReportWithUserDefinedFormatter() { var formatter = new Formatter(); formatter.AddFormatter(new CustomFormatter()); var reportContent = formatter.Format(ReportTemplate.Default, new[] { typeof(ICustomTest) }); StringAssert.Contains("<h3>Custom Settings</h3>", reportContent); StringAssert.Contains("Summary Custom Settings", reportContent); StringAssert.Contains("Custom External Setting", reportContent); }
public void Initialize() { Services.ConfigurationStore = new AppSettingsConfigurationStore(); Services.ThrowException = TestFrameworkProvider.Throw; Services.Reflector = new DefaultReflector(); Formatter.AddFormatter(new AggregateExceptionValueFormatter()); Formatter.AddFormatter(new XDocumentValueFormatter()); Formatter.AddFormatter(new XElementValueFormatter()); Formatter.AddFormatter(new XAttributeValueFormatter()); }
static JTokenAssertions() { Formatter.AddFormatter(new JTokenFormatter()); }
static DiagnosticAssertions() { Formatter.AddFormatter(new DiagnosticFormatter()); }
static AssertionExtensions() { Services.TestFramework = TestFrameworkProvider.TestFramework; Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
static ExceptionExtensionsNet40() { Formatter.AddFormatter(new AggregateExceptionValueFormatter()); }
public JTokenFormatterSpecs() { Formatter.AddFormatter(new JTokenFormatter()); }
static HttpResponseMessageAssertions() { Formatter.AddFormatter(new HttpResponseMessageFormatter()); Formatter.AddFormatter(new AssertionsFailuresFormatter()); }
public static void Register() { Formatter.AddFormatter(new ErrorListValueFormatter()); }
public FormatterScope(IValueFormatter formatter) { this.formatter = formatter; Formatter.AddFormatter(formatter); }