/ src / common / AllExperiments / Microsoft.VariantAssignment / Contract / EmptyVariantAssignmentResponse.cs
EmptyVariantAssignmentResponse.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 // The goal of this class is to just mock out the Microsoft.VariantAssignment close source objects 6 namespace Microsoft.VariantAssignment.Contract 7 { 8 public class EmptyVariantAssignmentResponse : IVariantAssignmentResponse 9 { 10 /// <summary> 11 /// Singleton instance of <see cref="EmptyVariantAssignmentResponse"/>. 12 /// </summary> 13 public static readonly IVariantAssignmentResponse Instance = new EmptyVariantAssignmentResponse(); 14 15 public EmptyVariantAssignmentResponse() 16 { 17 } 18 19 public long DataVersion => 0; 20 21 public string Thumbprint => string.Empty; 22 23 /// <inheritdoc/> 24 public IReadOnlyCollection<IAssignedVariant> AssignedVariants => Array.Empty<IAssignedVariant>(); 25 26 /// <inheritdoc/> 27 #pragma warning disable CS8603 // Possible null reference return. 28 public IFeatureVariable GetFeatureVariable(IReadOnlyList<string> path) => null; 29 #pragma warning restore CS8603 // Possible null reference return. 30 31 /// <inheritdoc/> 32 public IReadOnlyList<IFeatureVariable> GetFeatureVariables(IReadOnlyList<string> prefix) => Array.Empty<IFeatureVariable>(); 33 34 public void Dispose() 35 { 36 Dispose(true); 37 GC.SuppressFinalize(this); 38 } 39 40 protected virtual void Dispose(bool disposing) 41 { 42 } 43 44 string IVariantAssignmentResponse.GetAssignmentContext() 45 { 46 throw new NotImplementedException(); 47 } 48 49 IReadOnlyList<IFeatureVariable> IVariantAssignmentResponse.GetFeatureVariables() 50 { 51 throw new NotImplementedException(); 52 } 53 } 54 }