Exemple #1
0
        public void it_should_handle_id_conflict()
        {
            var type = new DroidType();

            type.Fields.Count().ShouldBe(2);
            type.HasField("id").ShouldBeTrue();
            type.HasField("droidId").ShouldBeTrue();
        }
Exemple #2
0
        public void HaveIdAndNameFields()
        {
            // When
            var droidType = new DroidType();

            // Then
            Assert.NotNull(droidType);
            Assert.True(droidType.HasField("id"));
            Assert.True(droidType.HasField("name"));
        }
        public void HaveIdAndNameFields()
        {
            // Given
            var characterRepository = new Mock <ICharacterRepository>();
            var mapper = new Mock <IMapper>();

            // When
            var droidType = new DroidType(characterRepository.Object, mapper.Object);

            // Then
            Assert.NotNull(droidType);
            Assert.True(droidType.HasField("Id"));
            Assert.True(droidType.HasField("Name"));
        }
Exemple #4
0
        public void HaveIdAndNameFields()
        {
            //Given
            var characterRepository = new Mock <ICharacterRepository>();

            // When
            var droidType = new DroidType(characterRepository.Object);

            // Then
            Assert.NotNull(droidType);
            Assert.True(droidType.HasField("Id"));
            Assert.Equal(typeof(NonNullGraphType <IntGraphType>), droidType.GetField("Id").Type);
            Assert.True(droidType.HasField("Name"));
            Assert.True(droidType.HasField("Friends"));
            Assert.True(droidType.HasField("AppearsIn"));
            Assert.True(droidType.HasField("PrimaryFunction"));
        }