Example #1
0
 public void should_trim_skipped_contexts()
 {
     contexts.Add(new Context());
     contexts[0].AddExample(new Example());
     contexts[0].Examples[0].HasRun = true;
     contexts.Count().should_be(2);
     contexts.TrimSkippedContexts();
     contexts.Count().should_be(1);
 }
        public void setup()
        {
            contexts = new ContextCollection();

            var context = new Context();

            context.AddExample(new Example());

            context.AddExample(new Example(pending:true));

            context.AddExample(new Example{Exception = new Exception()});

            contexts.Add(context);
        }
Example #3
0
        public void setup()
        {
            contexts = new ContextCollection();

            var context = new Context();

            context.AddExample(new Example());

            context.AddExample(new Example(pending: true));

            context.AddExample(new Example {
                Exception = new Exception()
            });

            contexts.Add(context);
        }
        public void setup()
        {
            contexts = new ContextCollection();

            var context = new Context();

            context.AddExample(new ExampleBaseWrap());

            context.AddExample(new ExampleBaseWrap { Pending = true });

            context.AddExample(new ExampleBaseWrap { Exception = new Exception() });

            context.Tags.Add(Tags.Focus);

            contexts.Add(context);
        }
Example #5
0
        public static void ParseContexts(XDocument report, Instance instance)
        {
            // parse contexts and add to instance
            // ix:header/ix:resources/xbrli:context
            var contextNs         = report.Root.GetNamespaceOfPrefix("xbrli");
            var contextElements   = report.Root.Descendants(contextNs + "context");
            var contextSerializer = new XmlSerializer(typeof(Context));

            var contexts = new ContextCollection(instance);

            foreach (var contextElement in contextElements)
            {
                var contextReader = contextElement.CreateReader();
                var context       = (Context)contextSerializer.Deserialize(contextReader);
                contexts.Add(context);
            }
            instance.Contexts = contexts;
        }
        public override async Task OnConnectedAsync()
        {
            Console.WriteLine($"[S] User {Context.ConnectionId} connected");

            if (_users.ContainsKey(Context.UserIdentifier) && !Context.Items.ContainsKey("IsAdded"))
            {
                Console.WriteLine($"User {Context.UserIdentifier} already connect");
                await Clients.Caller.SendAsync("SessionError", "User with this id already connected");

                return;
            }

            _users.Add(Context.UserIdentifier, Context);

            await Clients.Caller.SendAsync("Notify", $"Connected ConnectionId: {Context.ConnectionId} UserId: {Context.UserIdentifier}");

            await base.OnConnectedAsync();
        }
        public void setup()
        {
            contexts = new ContextCollection();

            var context = new Context();

            context.AddExample(new ExampleBaseWrap());

            context.AddExample(new ExampleBaseWrap(pending: true));

            context.AddExample(new ExampleBaseWrap {
                Exception = new KnownException()
            });

            context.Tags.Add(Tags.Focus);

            contexts.Add(context);
        }
        public void setup()
        {
            contexts = new ContextCollection();

            var context = new Context();

            context.AddExample(new Example());

            context.AddExample(new Example {
                Pending = true
            });

            context.AddExample(new Example {
                Exception = new Exception()
            });

            context.Tags.Add(Tags.Focus);

            contexts.Add(context);
        }