示例#1
0
    public FacetContext facet()
    {
        FacetContext _localctx = new FacetContext(Context, State);

        EnterRule(_localctx, 2, RULE_facet);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 32;
                Match(T__2);
                State = 33;
                normal();
                State = 34;
                loop();
                State = 35;
                Match(T__3);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
        public void Find_FromRepository_IsComplete(Type type, object id, Dictionary <string, object> expected)
        {
            // Act
            var entity = FacetContext.Find(type, new object[] { id });

            // Assert
            Assert.NotNull(entity);
            Asserter.EqualByDictionary(type, expected, entity);
        }
        public void GetAllFields_Called_SameAsDbSet()
        {
            // Arrange
            var resultRepository = MockResultRepository();

            // Act
            var result = resultRepository.GetAllFields().ToList();

            // Assert
            var expected = FacetContext.Set <ResultField>().ToList();

            Assert.Equal(expected, result);
        }
        public void Find_WhenCalleWithExistingId_ReturnsType()
        {
            // Arrange
            var repository = this.CreateRepository();
            var key        = "key";
            var data       = "data";

            repository.Add(new ViewState()
            {
                Key = key, Data = data
            });

            FacetContext.SaveChanges();

            // Act
            var result = repository.Get(key);

            // Assert
            Assert.Equal(data, result.Data);
        }