Ejemplo n.º 1
0
        public void PerceptronThrowsErrorWhenWeightsAreAllZero()
        {
            _network.GetAllConnections().Enumerate(connection => connection.Properties.Weight = 0d);

            //Note: NullReferenceException means exception wasn't thrown
            var exception = Assert.Throws <InvalidOperationException>(() => _perceptron.CheckTopology());

            exception.Message.Should().Be(Perceptron.WeightsAreAllZero);
        }