예제 #1
0
        public static void ParticipantColor_ToHex_FormatsCorrectly()
        {
            // Given
            Color            source = Color.BlueViolet;
            ParticipantColor target = source;

            // When
            string hexStr = target.ToHex();

            // Then
            Assert.That(hexStr, Is.EqualTo("8A2BE2"));
        }
예제 #2
0
        public static void ParticipantColor_FromColor_AssignsComponentsCorrectly()
        {
            // Given
            Color source = Color.BlueViolet;

            // When
            ParticipantColor target = source;

            // Then
            Assert.That(target.R, Is.EqualTo(source.R));
            Assert.That(target.G, Is.EqualTo(source.G));
            Assert.That(target.B, Is.EqualTo(source.B));
        }
예제 #3
0
 public PredefinedParticipantColor(string name, ParticipantColor participantColor)
 {
     this.Name  = name ?? throw new ArgumentNullException(nameof(name));
     this.Color = participantColor;
 }