Exemple #1
0
        public void Throws_on_attempt_to_start_tracking_different_entity_with_null_key()
        {
            var stateManager = CreateStateManager(BuildModel());
            var entity       = new Dogegory();

            var stateEntry = stateManager.GetOrCreateEntry(entity);

            Assert.Equal(
                Strings.NullPrimaryKey(typeof(Dogegory).FullName),
                Assert.Throws <InvalidOperationException>(() => stateManager.StartTracking(stateEntry)).Message);
        }
Exemple #2
0
        public void Throws_on_attempt_to_start_tracking_entity_with_null_key()
        {
            var stateManager = CreateStateManager(BuildModel());
            var entity       = new Dogegory();

            var entry = stateManager.GetOrCreateEntry(entity);

            Assert.Equal(
                CoreStrings.InvalidKeyValue("Dogegory"),
                Assert.Throws <InvalidOperationException>(() => stateManager.StartTracking(entry)).Message);
        }
        public void Throws_on_attempt_to_start_tracking_entity_with_null_key()
        {
            var stateManager = CreateStateManager(BuildModel());
            var entity = new Dogegory();

            var entry = stateManager.GetOrCreateEntry(entity);

            Assert.Equal(
                CoreStrings.InvalidPrimaryKey(typeof(Dogegory).FullName),
                Assert.Throws<InvalidOperationException>(() => stateManager.StartTracking(entry)).Message);
        }
        public void Throws_on_attempt_to_start_tracking_different_entity_with_null_key()
        {
            var stateManager = CreateStateManager(BuildModel());
            var entity = new Dogegory();

            var stateEntry = stateManager.GetOrCreateEntry(entity);

            Assert.Equal(
                Strings.FormatNullPrimaryKey("Dogegory"),
                Assert.Throws<InvalidOperationException>(() => stateManager.StartTracking(stateEntry)).Message);
        }