1 //
2 // Copyright (c) 2010-2018 Antmicro
3 //
4 //  This file is licensed under the MIT License.
5 //  Full license text is available in 'licenses/MIT.txt'.
6 //
7 using System;
8 using Antmicro.Renode.Peripherals.Bus;
9 using Antmicro.Renode.Utilities;
10 
11 namespace Antmicro.Renode.Tests.UnitTests.Mocks
12 {
13     public class MockPeripheralWithEnumAttribute : IBytePeripheral
14     {
MockPeripheralWithEnumAttribute(MockEnum mockEnum = MockEnum.ValidValue, MockEnumWithAttribute mockEnumWithAttribute = MockEnumWithAttribute.ValidValue)15         public MockPeripheralWithEnumAttribute(MockEnum mockEnum = MockEnum.ValidValue, MockEnumWithAttribute mockEnumWithAttribute = MockEnumWithAttribute.ValidValue)
16         {
17             MockEnumValue = mockEnum;
18             MockEnumWithAttributeValue = mockEnumWithAttribute;
19         }
20 
Reset()21         public void Reset()
22         {
23         }
24 
ReadByte(long offset)25         public byte ReadByte(long offset)
26         {
27             throw new NotImplementedException();
28         }
29 
WriteByte(long offset, byte value)30         public void WriteByte(long offset, byte value)
31         {
32             throw new NotImplementedException();
33         }
34 
35         public MockEnum MockEnumValue { get; set; }
36         public MockEnumWithAttribute MockEnumWithAttributeValue { get; set; }
37 
38         public enum MockEnum : byte
39         {
40             ValidValue = 1
41         }
42 
43         [AllowAnyNumericalValue]
44         public enum MockEnumWithAttribute : byte
45         {
46             ValidValue = 1
47         }
48     }
49 }
50