예제 #1
0
        static AssertionExtensions()
        {
            Services.TestFramework = new SilverlightTestFramework();
            Services.Reflector     = new SilverlightReflector();

            Formatter.AddFormatter(new AggregateExceptionValueFormatter());
        }
예제 #2
0
        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());
        }
예제 #6
0
        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());
        }
예제 #10
0
        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());
        }
예제 #11
0
        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);
        }
예제 #12
0
        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());
        }
예제 #13
0
 static JTokenAssertions()
 {
     Formatter.AddFormatter(new JTokenFormatter());
 }
예제 #14
0
 static DiagnosticAssertions()
 {
     Formatter.AddFormatter(new DiagnosticFormatter());
 }
예제 #15
0
        static AssertionExtensions()
        {
            Services.TestFramework = TestFrameworkProvider.TestFramework;

            Formatter.AddFormatter(new AggregateExceptionValueFormatter());
        }
예제 #16
0
 static ExceptionExtensionsNet40()
 {
     Formatter.AddFormatter(new AggregateExceptionValueFormatter());
 }
예제 #17
0
 public JTokenFormatterSpecs()
 {
     Formatter.AddFormatter(new JTokenFormatter());
 }
예제 #18
0
 static HttpResponseMessageAssertions()
 {
     Formatter.AddFormatter(new HttpResponseMessageFormatter());
     Formatter.AddFormatter(new AssertionsFailuresFormatter());
 }
예제 #19
0
 public static void Register()
 {
     Formatter.AddFormatter(new ErrorListValueFormatter());
 }
예제 #20
0
 public FormatterScope(IValueFormatter formatter)
 {
     this.formatter = formatter;
     Formatter.AddFormatter(formatter);
 }