File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
tests/Synercoding.Primitives.Tests Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -139,5 +139,39 @@ public void FromDesignation_WithPixels_ThrowsArgumentException()
139
139
140
140
Assert . Throws < ArgumentException > ( ( ) => Unit . FromDesignation ( designation ) ) ;
141
141
}
142
+
143
+ [ Fact ]
144
+ public void MultiplicationOperator_WithLeftDouble_IsUnitValue ( )
145
+ {
146
+ // Arrange
147
+ var left = 2d ;
148
+ var right = new UnitValue ( 5 , Unit . Millimeters ) ;
149
+ var expected = new UnitValue ( 10 , Unit . Millimeters ) ;
150
+
151
+ // Act
152
+ var result = left * right ;
153
+
154
+ // Assert
155
+ Assert . Equal ( expected , result ) ;
156
+ Assert . Equal ( expected . Value , result . Value ) ;
157
+ Assert . Equal ( expected . Unit , result . Unit ) ;
158
+ }
159
+
160
+ [ Fact ]
161
+ public void MultiplicationOperator_WithRightDouble_IsUnitValue ( )
162
+ {
163
+ // Arrange
164
+ var left = new UnitValue ( 5 , Unit . Millimeters ) ;
165
+ var right = 2d ;
166
+ var expected = new UnitValue ( 10 , Unit . Millimeters ) ;
167
+
168
+ // Act
169
+ var result = left * right ;
170
+
171
+ // Assert
172
+ Assert . Equal ( expected , result ) ;
173
+ Assert . Equal ( expected . Value , result . Value ) ;
174
+ Assert . Equal ( expected . Unit , result . Unit ) ;
175
+ }
142
176
}
143
177
}
You can’t perform that action at this time.
0 commit comments